A video showing the dance-off between a beat cop and a high school student spread online this week, with many observers praising it as a positive example of police interacting with the communities they serve.

After D.C. police broke up a two groups of fighting teenagers Monday, one officer asked the group to disperse. Aaliyah Taylor, 17, approached the officer and played the song “Watch Me (Whip/Nae Nae)” on her phone and then performed the popular dance associated with the song, according to The Washington Post.

The officer said she had better dance moves and challenged Taylor: If you win, the group can stay; if I win, you leave.

D.C. Police Chief Cathy Lanier thanked the president for his support.

"Thank you @POTUS engaging with residents thru dance is part of our dedicated community policing effort in the nation's capital," she wrote on the department's Twitter account.

The incident presented a stark contrast with the South Carolina officer, who was fired this week after being caught on video throwing a black student out of her chair in a high school classroom.

Obama is in the midst of a tour promoting his push for criminal justice reform, which is designed to repair frayed relations between police and minority communities and reduce the nation’s ballooning prison population.

He gave a speech to the International Association of Chiefs of Police in Chicago to promote his agenda Tuesday. And next Monday, he will travel to Newark, N.J., to discuss criminal justice issues.