Some 12 people were injured in Friday’s demonstration with dozens of protesters.
Two men were arrested for allegedly attacking police in the confrontation. Just hours later, lawmakers in Beijing opened a meeting expected to issue a binding ruling on how Hong Kong selects its leader and legislature.
Beijing shocked Hong Kong last week by announcing that the mainland's most powerful legislative panel would weigh in on the matter.
More than 2000 pro-democracy activists held a peaceful candlelight vigil on Thursday night, charging that China was violating Hong Kong's autonomy and that the territory's leader Tung Chee-hwa was blindly going along with it.
Some 400 people then rushed to the central government headquarters and about 20 students barged onto the grounds late on Thursday. The demonstrators want Hong Kong, which now only has a limited say in its government to gain the right to choose its leader and all of the territory's lawmakers.
But Beijing appears unlikely to approve such changes.
One country, two systems?
Security guards evicted the students early on Friday, and police ordered remaining protesters outside the compound to disperse, saying their protest lacked a permit and was illegal.
Hong Kong chief executive Tung
Chee-hwa is unpopular
But the protesters refused and scuffles broke out when police began carrying them away from a gated entrance to let government employees go to work, said police spokeswoman Ivy Yue.
Five police officers and seven demonstrators suffered minor injuries, the police said.
Two men were arrested, one for striking an officer and another for biting an officer, police spokesman Ng Ting-kai said.
Critics say China is eroding Hong Kong's autonomy guaranteed after Britain returned this former colony to the motherland in July 1997 under an arrangement dubbed "one country, two systems."
"The government is ignoring the people," said protester Eddie Chow. "We're being forced to take to the streets to fight for our rights."
Hong Kong's No. 2 official, Chief Secretary for Administration Donald Tsang, said Beijing's coming ruling on political reforms was necessary and "harmless" to Hong Kong, and urged protesters to calm down.
Democracy advocates also organized a march by 500,000 people last 1 July that stunned the Hong Kong and mainland governments, and ultimately forced Tung to back down on an anti-subversion bill that many here viewed as a threat to freedom.
Full democracy is set out as an eventual goal in Hong Kong's mini-constitution, although no timetable is given.
Ordinary Hong Kongers do not pick their leader. The highly unpopular Tung was chosen by an 800-member elite committee loyal to Beijing. Voters will pick 30 of Hong Kong's 60 lawmakers in September, but the rest are chosen by special interest groups who tend to side with Tung and Beijing.