The gunmen surrounded the building, where town councilors have their offices, taking positions on the roof and balconies and firing in the air, The Associated Press reported.
Salaries for the government's 140,000 employees are two weeks overdue.
Western nations have cut off aid to the cash-strapped Palestinian Authority, demanding Hamas renounce violence and recognise Israel's right to exist. Israel also cut off the monthly transfer of about $50 million in taxes it collects on behalf of the Palestinians.
The Palestinian finance minister on Saturday asked government workers to be patient.
"They know that the treasury is empty," Omar Abdul Razak told Aljazeera. "We urge all Palestinians to stand hand in hand with the government until the crisis is resolved."
Masked police storm a government
building in Khan Younis (Aljazeera)
Sporadically firing rifles in the air, the gunmen paralyzed Khan Younis, forcing workers traveling from northern Gaza to get out of their cars and walk more than a kilometer (half a mile) to get into town.
The main road links the central Gaza town with the rest of the strip
Those heading to the southern town of Rafah had to take back roads.
Stores in the town were closed, and residents gathered to watch the demonstration. Dozens of schoolchildren left their school after the gunmen fired outside their building.
Demand for salaries
"We want salaries. We want the government to live up to its responsibilities," said a leader of the protest who gave his name only as Abu Hassan. "If they don't have the ability to secure our salaries and to guarantee good living conditions for the people, they either have to step aside or to ask the people what the next step must be. They cannot act alone."
The protest came a day after Ismail Haniyeh, the prime minister, told thousands of supporters that his government would not cave into financial pressure.
"Attempts to destroy this government and put obstacles before it and disrupt it will only be met with more steadfastness, resolve and solidarity," Haniyeh told a rally on Friday.
The Khan Younis building houses
offices of town councilors (Aljazeera)
The gunmen, loyal mainly to the former ruling party Fatah, in the past have staged protests demanding jobs or pay raises.
The Palestinian Authority is the largest employer in the West Bank and Gaza Strip, sustaining about one-third of the population.
Israeli officials say they hope the financial pressure forces Hamas to moderate or stirs enough popular discontent to remove the government.
Also on Saturday, the Israeli army launched a new artillery barrage at the Gaza Strip in response to the volleys of homemade Qassam rockets launched at Israel by Gaza militants, the army said.
The shelling has increased in intensity and frequency, with up to 10 shells being fired per minute in eastern and northern Gaza, Aljazeera.net's correspondent in Gaza reported on Saturday.
The explosions were heard in Gaza City, shaking windows and homes and damaging buildings in northern Gaza.
Last week, a 9-year-old girl was killed and her 13 family members wounded, some seriously, when one of the shells hit their home.
Palestinian medical sources say that at least 40 Palestinians have been wounded in the past week and that 90 children have been treated for shock as a result of the shelling.
The cross-border fighting has escalated in the past week, with 16 Palestinians in Gaza killed by Israeli shelling and attacks on militants.
Aljazeera.net's Laila El-Haddad in the Gaza Strip contributed to this report.