A Libyan official with the Islamist-backed government controlling the capital, Tripoli, says they have detained 300 African migrants captured while boarding boats headed to Europe.

Military spokesman Mohamed al-Shamy said Friday that the migrants, mainly from sub-Saharan Africa, were captured Tuesday on a beach east of Tripoli.

"This is the largest group we have ever caught at once," he said.

Thousands of migrants seeking a better life in Europe cast off from Libya on rickety boats, hoping to reach Italy. The International Organization for Migration says that more than 2,600 migrants have died in 2015 so far on the Central Mediterranean route that includes Libya.

Smugglers have exploited Libya's internal turmoil, with two rival governments battling for control, to ship thousands of desperate migrants across the Mediterranean.