A police officer in the US broke up a crowd in an unorthodox manner, by challenging a schoolgirl to a dance off.

Officers in Washington D.C were attempting to disperse a crowd following a fight between two groups of teenagers, when Aaliyah Taylor, a 17-year-old senior at Ballou High School, walked up to the officer and started playing “Watch Me (Whip/Nae Nae)” on her phone.

Officials say the video shows that police officers have a human side. Credit: NBC News/Antwain Bynum

Then she did the accompanying dance, reportedly prompting a female officer to remark that she had "far better" dance moves than that.

What followed was an impressive display of dancing skill from the cop - including an excellent stanky leg - that serves perhaps as a reminder that a good nature and a sense of rhythm are useful tools for any law enforcement official.

Marinos Marinos, the secretary of the D.C. police union, told the Washington Post that personal interactions like this between officers and residents aren’t unusual — it’s just that most don’t make it to the internet.

“We are humans just like everyone else,” Marinos said. “Everyday we come in contact with thousands of citizens and almost all of them have positive outcomes.”

According to the Washinton Post, the officer says that she doesn’t want to reveal her identity because the story isn’t about her. She had joined the department three years ago and recently completed a tour in Iraq with the military.

Barack Obama tweeted his praise of the incident, saying: "Who knew community policing could involve the Nae Nae? Great example of police having fun while keeping us safe"

“I thought all cops were cruel because that’s how I saw them,” Taylor said. “I’ve now seen there are good cops out there.”