The Libyan Army had launched an attack on armed groups in Bani Walid after a siege of more than two weeks. Troops hit targets in the southeastern city as five of the government troops were wounded in the clash, which saw the forces capture a tank from the militia.
Army forces had besieged the town while tribal leaders tried to broker a peaceful solution between the two sides. Sporadic clashes left scores of troops and civilians dead.
Ibrahim was captured in the town of Tarhouna, which lies between Tripoli and Bani Walid.
During the conflict last year in Libya, Ibrahim held regular press conferences for international journalists in Tripoli. His whereabouts had been unknown since rebels took over Tripoli in August 2011.
Saturday was the anniversary of the killing of Muammar Gaddafi in his birthplace, Misurata.
"The campaign to liberate the country has not been fully completed," Mohammed Magarief, head of Libya's National Congress, said on state television.
Colonel Ahmed Omran Abouhlalh told the official news agency that security forces tightened their grip on the 40-kilometre coastal road that links the capital with the town of al-Zawiya.
Troops took control of the road after a group of Gaddafi loyalists tried to block the highway, the report said.
Libya's new rulers have ordered that illegal militias be disbanded and have launched a disarmament drive, in an effort to re-establish security.
-AAP