The gunmen were from the al-Aqsa Martyrs' Brigades, a military wing of Fatah. Fatah, which dominated Palestinian politics for decades, was defeated by Hamas in January parliament elections.
About 20 al-Aqsa gunmen seized the three-story Cabinet building in Ramallah for about an hour, before members of the security forces persuaded them to leave. Many of the gunmen also work in the security forces.
Earlier on Thursday, the group had shut down the Transportation Ministry, forcing employees to leave the building.
An al-Aqsa spokesman said the gunmen were upset over the refusal of the Hamas government to meet their demands. The spokesman, Kamal Saffaka, said that the previous government, run by Fatah, had awarded them hundreds of taxi licenses as perks. Each license is worth thousands of dollars.
The group demanded that its members get promotions in the security forces.
Hamas had campaigned on a clean government platform.
Many Palestinians voted for the Islamic militant group because they were fed up with widespread official corruption and the lawlessness of Fatah-linked gunmen.