TRIPOLI (Reuters) - Libya's Prime Minister Ali Zeidan said on Friday former rebels who abducted him briefly were part of an attempted "coup" by his opponents in the country's legislature, accusing them of seeking to undermine his government.

Gunmen snatched Zeidan from the Tripoli hotel where he lives during a dawn raid on Thursday only to release him hours later in an incident that showed how far Libya has descended into militia-plagued chaos two years after Muammar Gaddafi's fall.

"They wanted to overthrow the government," Zeidan said in a national address. "This was not an attempted kidnapping only of a prime minister, but of the government."

He accused members within the General National Council, the country's national assembly, of plotting the abduction. The assembly is caught in a deadlock between secular leading party and the Muslim Brotherhood, and Zeidan has been facing a possible vote of no confidence.

The former rebels, now on the government payroll, who snatched Zeidan said they were angry at reports the government had been informed in advance of a U.S. raid to capture an al Qaeda suspect there.

(Reporting by Ulf Laessing; Writing by Patrick Markey; Editing by Alison Williams)