The Libyan navy on Saturday rescued 252 migrants seeking to reach Europe, in two separate operations off the country's western coast.
"We were alerted... to the position of a migrant boat" around 30 kilometres (20 miles) off Zawiya, west of Tripoli, navy captain Rami al-Hadi Ghomed said.
He said the 140 migrants on board, including 14 women and four children, were brought back to Tripoli's naval base before being transferred to a detention centre.
Since the 2011 fall and killing of longtime dictator Moamer Kadhafi, unruly Libya has become a key launch pad for migrants making desperate bids to reach Europe, often on unseaworthy vessels.
To save money to pay smugglers for the crossing, some migrants stay and work in Libya -- such as Sunday Adeleghe, a 42-year-old Nigerian father of four.
He was among those who tried their luck on the boat rescued off Zawiya.
"I left my country in June," he said. "I couldn't go back to Nigeria with nothing."
"I started washing cars to save money for my family," he said.
"I'm desperate... but a man can die only once, not twice."
The second rescue operation took place around 50 kilometres off Garabulli, east of the capital.
The navy rescued "112 migrants, including 30 women and three children, aboard an inflatable boat", said navy spokesman Ayoub Kacem.
"The migrants, from African countries.... were given medical care before being transferred to the Tajoura detention centre" in Tripoli, Kacem said.
The navy gave no details on the origin of the boats, but smugglers usually launch departures from western Libya, just 300 kilometres from the Italian coast.
Recent years have seen thousands of migrants infiltrate the vast southern border of Libya in attempts to cross the Mediterranean to Europe.
The situation has deteriorated since Kadhafi's fall, as lawlessness and insecurity have pushed ever more migrants who were already present in Libya to attempt the perilous crossing.
At least 337 migrants have died or disappeared off the coast of Libya since the start of the year, according to the International Organization for Migration.
"If our rulers were good for us, Nigerians would not leave their country," Sunday said.