The law, drafted by the government and passed by a show of hands on Monday, included a last-minute concession to the media that appeared aimed at easing journalists' fears they could be jailed for reporting accusations of government corruption.
But opposition activists and many journalists say the bill puts new limits on press freedom and was another setback for Egyptian liberals.
Under pressure to show evidence of political change, Mubarak promised two years ago to abolish custodial sentences for publishing offences.
But the Egyptian government has also tried to take back some of the freedoms it appeared to concede last year during the height of the US campaign for democracy in the Middle East, such as the right to protest peacefully without police intervention.
The press law comes just two weeks after the government pushed through a similarly divisive judiciary law that opponents said did not guarantee that judges can be independent of the executive.
"At the end of the day, we are just in full-scale deliberalisation," said Josh Stacher, an independent Cairo-based political analyst.
But he said: "I don't think we are going to see a full-scale crackdown. It is something to be held in reserve."
The Egyptian government says the press law is a step towards a freer press because it does abolish some custodial sentences, for example for libel.
Parliament, at Mubarak's suggestion, ultimately removed a clause that would have allowed jail terms for journalists who impugn the financial integrity of officials or state employees, parliamentary sources said.
"At the end of the day, we are just in full-scale deliberalisation"
Josh Stacher, political analyst
But it retained increases in the maximum fines that can be imposed on reporters for offences such as libel.
In the last few years, independent Egyptian newspapers have emerged that have proved willing to hold the rich and powerful elite to account, right up to the presidency. The old state-owned newspapers are beginning to lose their readership.
Egypt's independent and opposition newspapers did not publish on Sunday to protest against the law, and several hundred journalists and activists marched peacefully to try to stop the law passing. State-owned papers went to press as normal.
The opposition Muslim Brotherhood, which holds nearly a fifth of the seats in a parliament dominated by the ruling National Democratic Party, has also objected to the law.