Long sentences and fines will also apply to those found to incite "hatred or contempt" towards the coup leaders, the military said.
The legal changes were announced as armoured vehicles appeared on the streets of several cities.
Hundreds of thousands of people have taken part in protests in recent days.
The demonstrators are demanding the release from detention of their elected leaders, including Aung San Suu Kyi, and the restoration of democracy in Myanmar, also known as Burma.
On Monday, Ms Suu Kyi's lawyer said she would be detained for a further two days. She will then be tried via video link at a court in the capital Nay Pyi Taw on Wednesday, Khin Maung Zaw added.
Ms Suu Kyi was rounded up with other members of the government on 1 February, but her detention was due to end on 15 February, according to Reuters news agency.
The charges against her include possession of unlawful communication devices - walkie-talkies used by her security staff.
Her party was elected in a resounding victory last November, but the military has alleged voter fraud without providing proof.
Internet access in Myanmar is being blocked for a second consecutive night, an internet service provider has told BBC Burmese.
What are the new punishments protesters face?
The ruling junta has threatened long prison sentences and fines on anyone found to incite hatred towards the military, "by words, either spoken or written, or by signs, or by visible representation".
In a statement posted on a military website on Monday, it said that people preventing the security forces from carrying out their duties could face 20 years in prison, while those found to stir up fear or unrest in public could be imprisoned for terms of three to seven years.
The military government on Saturday gave itself the power to make arrests, carry out searches and hold people for more than 24 hours without a court ruling.
It has also told journalists not to describe the military's takeover as a coup.
What is happening on the streets?
The military's heightened presence is the latest sign of a potential crackdown on opposition to the coup. At many strategic locations, soldiers have replaced the police.
In the main city, Yangon, eight-wheeled armoured vehicles have been seen trying to navigate the rush-hour traffic, sometimes surrounded by cars honking their opposition to the coup.
Protests focused on the central bank building, the US and Chinese embassies, and the city headquarters of Ms Su Kyi's National League for Democracy.
