The demonstrators smashed windows and doors at the building in Minsk, but were later pushed back by riot police.
Four presidential candidates were arrested. Another was injured in an earlier incident.
Incumbent Alexander Lukashenko has been declared the winner, but the opposition claims the result is rigged.
Official results announced early on Monday gave President Lukashenko 79.7% of the vote. This will the authoritarian leader's fourth term in office.
During his presidency, the former Soviet republic has never held a poll seen as fair by international monitors.
However, the election campaign itself was much freer than in the past, correspondents say.
By late Sunday evening at least 10,000 protesters had gathered in central Minsk, denouncing the elections as fraudulent.
Waving unofficial Belarusian white-red-white flags, they shouted: "For Freedom!", "Down with Lukashenko!" and "Down with Gulag (Soviet-era labour camps)!"
The demonstrators then tried to storm the government building but were pushed back by the riot police.
Dozens of protesters were injured in clashes after being beaten with batons, according to eyewitnesses.
More riot police then arrived in central Minsk and began dispersing the demonstrators. There were also reports of mass arrests.
A BBC correspondent in Minsk says four presidential candidates were among those detained: Andrey Sannikov, Nikolay Statkevich, Grigory Kostusev and Vitaly Rymashevsky.
'Read our laws'
Earlier another opposition candidate Vladimir Neklyaev was injured when the police broke up a rally staged by some 200 of his supporters.
Mr Neklyaev's campaign activists told the BBC that he was badly beaten and taken to hospital with head injuries.
His wife said he was later taken by police from his hospital bed, Reuters news agency reported.
Mr Lukashenko had earlier warned his opponents against organising rallies as he cast his vote.
"What is awaiting supporters of the protest - read our laws. Everything will be in strict accordance with the law.
"Don't worry, nobody is going to be on the square tonight," the president added.
Police had earlier warned they would crack down hard on any protests.
Nine challengers were competing with Mr Lukashenko for the presidency.
For the first time, state television aired a debate among the contenders opposing the president, who has governed since 1994.
Mr Lukashenko - who remains popular among large sections of the population - did not take part in the discussion.
The authorities also allowed activists to collect signatures during the election campaign, perform protest songs and read anti-government poetry.
Despite this, many in Belarus believe that the election day result has already been pre-ordained and the political thaw is merely window-dressing, the BBC's David Stern in Minsk reports.
"Lukashenko needs this to show to the Europeans because he needs money from Europe," Andrei Sannikov, one of the three main opposition candidates, said earlier this week.
"The economy is in very bad shape and he needs additional credits," he said.
Mr Lukashenko, who denies the opposition's claim, has said he is not planning to leave, whether by the ballot box or other means.
Asked by reporters last week if the vote would bring any political changes, he said: "There will definitely be political changes. I am sure you meant political changes in general, but no change of power in Belarus."