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 on Friday and provided an explicit warning for young men.

鈥淲e 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.

鈥淚n 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 鈥渦nder any circumstances鈥 and to avoid large crowds.

鈥淚f 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 鈥渂e 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 鈥渁re 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