The Bahamas has issued a rare travel advisory for citizens visiting the U.S., warning them to be cautious in cities affected by recent fatal police shootings.

The island nation released the advisory on Friday and provided an explicit warning for young men.

“We wish to advise all Bahamians traveling to the U.S. but especially to the affected cities to exercise appropriate caution generally,” the Bahamian Ministry of Foreign Affairs wrote in the statement.

“In particular young males are asked to exercise extreme caution in affected cities in their interactions with the police. Do not be confrontational and cooperate.”

The notice also warns travellers to not become involved in political or other demonstrations “under any circumstances” and to avoid large crowds.

“If there is any issue please allow consular offices for The Bahamas to deal with the issues,” the statement reads.

The travel advisory also warns citizens to be aware of the city they are travelling to, pay attention to local notices and “be sensible.”

The warning comes amid rising tensions between black Americans and police. Two black men, Alton Sterling of Louisiana and Philando Castile of Minnesota, were shot and killed by police officers earlier this week in separate incidents. Video footage of both deaths shot by eyewitnesses quickly circulated online and drew widespread outrage.

In the days that followed, American police officers were shot at in Georgia, Missouri and Tennessee, and five police officers were killed by a sniper in Dallas on Thursday night during a march to protest the deaths of Sterling and Castile. The Dallas shooting, which authorities say specifically targeted white officers, made Thursday the deadliest day for U.S. law enforcement since the terror attacks on Sept. 11, 2001.

U.S. President Barack Obama condemned the violence and said Americans “are better than this” in a news conference on Thursday.

"When incidents like this occur, there's a big chunk of our fellow citizenry that feels as if it's because of the colour of their skin, they are not being treated the same," Obama said. "And that hurts. And that should trouble all of us."

With files from The Associated Press