Mayor Liu Qi also suspended new licences that are still waiting for safety inspections.
Most of the victims of the fire were students, attracted by the cafe's cheap late-night internet rates; there was only one exit to the room, and the windows were barred.
Tens of thousands of internet cafes have sprung up in China in recent years, with many people - especially the young - seizing the chance to explore life in other countries through the internet.
Internet fans
State media said the blaze started at the Lanjisu Cyber Cafe in the early hours of Sunday morning, in Beijing's university district.
Police cordoned off the area and were inspecting the soot-stained shell of the two-storey concrete building which housed the cafe.
Firefighters managed to put the fire out within an hour.
Although the cause is not yet known, Mayor Liu Qi decided to act quickly.
"From now on, Beijing will not encourage the development of internet bars," he said.
"From today, all internet bars should stop operation and departments concerned should stop issuing licences."
Internet cafes are enormously popular in China and their number has risen sharply in recent years, with many of them open 24 hours a day.
Internet policing
Correspondents say China's tight controls on the internet have driven many operators underground.
An official hi-tech police - nicknamed "the great firewall of China" - keeps watch over the internet 24 hours a day.
Its job is to keep web users from accessing information considered unhealthy by the government - including pornography and political material.
However, the BBC's Rupert Wingfield-Hayes in Beijing says the government is struggling to contain the flow of information, as the internet is allowing people from every corner of China to engage with each other in debate.
Analysts say many Chinese youths turn to illegal cyber cafes because they cannot afford their own computer, and still others are lured by the freedom of anonymous internet access.
A few weeks ago, a senior figure in China's Communist government expressed concern about the amount of time young people are spending surfing the internet and called for tighter regulation of cyber cafes.