Tripoli: Gunmen attacked the home of Libya`s new prime minister Tuesday, as the growing security concerns prompted Washington to recommend Americans leave the country "immediately".
Meanwhile, jihadist group Ansar al-Sharia, targeted by an ex-general who says the country has become a "terrorist hub," has called on Libyans to repudiate him.
Businessman Ahmed Miitig, 42, was elected prime minister this month in a chaotic vote by the General National Congress (GNC) to replace Abdullah al-Thani, who resigned in April after claiming he and his family had been attacked.
An aide to Miitig said "there was an attack with rockets and small arms on the prime minister`s house" in Tripoli at 3:00 am (0100 GMT).
The premier and his family were in the house at the time, but escaped unharmed.
His guards opened fire on the group, wounding and arresting two of them, the official added.In Washington, the US State Department recommended Americans in Libya "depart immediately," in its latest travel warning.
The warning comes amid worsening unrest in Libya, where militia battles have plunged the country into chaos.
"Due to security concerns, the Department of State has limited staffing at Embassy Tripoli and is only able to offer very limited emergency services to US citizens in Libya," the travel warning said.
"Because of the presumption that foreigners, especially US citizens, in Libya may be associated with the US government or US NGOs, travellers should be aware that they may be targeted for kidnapping, violent attacks, or death," it added.
"US citizens currently in Libya should exercise extreme caution and depart immediately," it said.
Earlier Tuesday, the United States announced it was deploying an amphibious assault ship with about 1,000 marines off the coast of Libya in case the US embassy must be evacuated.
The USS Bataan was to be in the area "in a matter of days," said a defence official, who spoke on condition of anonymity, adding it was a "precautionary" measure.
The precautions come amid ongoing controversy over a September 2012 attack on the US consulate in Benghazi in which four Americans, including ambassador Christopher Stevens, were killed.
In addition to the 1,000 marines, the Bataan is equipped with several helicopters.
The United States also has available 250 marines, seven tilt-rotor Osprey aircraft and three refuelling aircraft in Sigonella, Italy.
The GNC passed a vote of confidence in Miitig, who is backed by the Islamists, and his new cabinet amid rising lawlessness in the North African nation dogged by power struggles among rival former rebel militias.
Libya has been awash with weapons since the NATO-backed uprising that killed longtime dictator Moamer Kadhafi in 2011.
Successive governments have failed to control the myriad militias that have carved out fiefdoms across the country, and Miitig is Libya`s fifth premier since Kadhafi`s ouster.
He is due to lead a transition until legislative elections are held on June 25, and a new parliament replaces the GNC and a new cabinet is formed.
Miitig assumed office to already mounting opposition and with rogue former general Khalif Haftar gathering support for an offensive he launched in the eastern city of Benghazi on May 16.
Near daily attacks blamed on jihadists had been targeting security forces in Benghazi, and several military units have thrown their support behind Haftar.The GNC has accused Haftar of launching a coup but he said the Libyan people had given him a "mandate" to crush jihadists after thousands of people rallied in his support in Benghazi and Tripoli.
On Tuesday, Ansar al-Sharia chief Mohammed el-Zehawi urged Libyans not to support Haftar, who he claimed "wants to divide us".
Accusing him of being a "new Kadhafi" and an "agent of American intelligence", he affirmed his group`s determination to fight the "tyrant".
Meanwhile, Miitig has tried to reach out to critics, inviting them to take part in a "comprehensive national dialogue to complete state institutions".
He has also committed to "pressing the battle against terrorists and those who threaten the security of the country," referring to jihadists in the east.
But just hours after Miitig and his cabinet were approved by the GNC, autonomist rebels who have been blockading eastern oil terminals said they did not recognise his "illegal" government.
"We reject the government of Ahmed Miitig," said Ibrahim Jodhran, self-proclaimed head of the Cyrenaica Political Bureau, a group demanding greater autonomy for Libya`s eastern region.
No official list of cabinet members has been published until now, and the 2014 budget has yet to be passed because of deep political divisions within the GNC.