Foreign Affairs Minister John Baird has told the House of Commons he is deeply concerned by the legislation, which he says runs counter to core Canadian values of freedom of speech, human rights and the rule of law.
The warning comes after the governor of St. Petersburg signed a law that makes it a criminal offence to publicize acts of sodomy, bisexualism or lesbianism.
The city says the law, which comes into effect Saturday, is designed to protect children.
But gay rights groups see it as part of a backlash led by some politicians and the Russian Orthodox Church.
St. Petersburg is the fourth Russian city to be enact such a law.
Baird said Canada has lodged an official protest, as well as warning travellers.
"Canada's ambassador has written to the Russian government to express our deep concern and, yes, we have at his request, put a travel advisory on our website," Baird said.
Scenic, historic and cosmopolitan, St. Petersburg is one of Russia's — if not one of the world's — top travel destinations.
Canada's new travel advisory has been amended to read: "Homosexuality is legal, though some still strongly disapprove of it. Canadians are advised to avoid displaying affection in public, as homosexuals can be targets of violence."
The advisory states that the new law prohibits "propagandizing homosexuality, lesbianism, bisexuality and transsexuality among minors, and prohibiting public actions propagandizing pedophilia."
Among other things, the advisory warns travellers against "displays or conspicuous behaviour," which could lead to arrest or a fine.
Baird said he will consider amending travel advisories to other destinations to deal with specific threats to gay and lesbian travellers.
"We'll certainly look at that," said Baird. "Obviously one of the core responsibilities I have as Canada's foreign minister is to promote Canadian values around the world, and I will continue to do this."