A Metropolitan Police officer repeatedly struck a teenager with a metal baton using "unlawful" force while the boy asked him to stop, a court has heard.

Detective Constable Kevin Rowley, from Southend, denies assault by beating following the incident on April 22 last year, when he struck the boy five times with his police-issued baton after he and a colleague stopped two youths on Heath Park Road in Romford, east London.

Mobile phone footage taken by a member of the public was played to Hendon Magistrates' Court today, which appeared to show Rowley striking a black male outside the Smokin' Griddle Cafe, as the youth shouted "you can't do this" and "I'm a child...this is illegal".

The footage, taken from a passing car and widely shared on social media, showed members of the public shouting at Rowley to stop as the teenager cried out for help.

Prosecuting, Arabella MacDonald told the court there is "no dispute that force was used", but alleged there was an "unlawful application of force by violence" during the incident.

The court heard Rowley and another police officer attempted to carry out a stop and search after he claimed he spotted the 18-year-old, who was 17 at the time, holding a "wad of cash" while walking with another youth.

The 37-year-old said he and his colleague, who were both in plain clothes, told the pair they were going to search them for drugs after apparently smelling cannabis.

Rowley told the court on Thursday he repeatedly asked the youth to take his hands out of his pocket, where he was reaching for a Samsung mobile phone.

He said after taking the phone, he put the teenager in a headlock, took him to the floor and took hold of his wrists, as the other police officer chased the other youth as he fled.

"I'm now alone with an agitated and aggressive male who is not complying and made it clear from the start with his words of, 'you ain't searching me, I know my rights'," Rowley told the court.

He said that he told the youth to calm down and explained he was handcuffing him for his safety, which resulted in a struggle between the pair.

"At first I thought that had worked," he said, "He just lost it. He got more aggressive and got to his feet."

Rowley told the court he had delivered "two to three" knee strikes to the teenager to the thigh, adding: "I wasn't trying to hurt him. All I was trying to do was detain him."

On why he used his baton, he said: "I had gone through handcuffs, verbal commands, knee strikes - my only option was to draw my baton."

He said he used his baton to strike him "five times on the thigh as per our officer safety training".

He added: "I said to him I did not want to use force but I will if you do not comply."

The incident was referred to the police watchdog, the Independent Office for Police Conduct (IOPC).

Giving evidence, eyewitness Anthony Bailey, who lives across from the incident, said Rowley looked as if he was "trying to restrain" the teenager.

"It seemed to me the young male was trying to struggle and I think a couple of times he said, 'you're hurting me'," he told the court.

Mr Bailey said he saw Rowley produce a baton and strike the youth "three times...behind the knee and calf area".

Terri Vigors, who lives in a flat on the row of shops where the incident occurred, witnessed the incident and told the court the teenager let Rowley put him in handcuffs.

"He removed his stick baton thing and he had repeated quite a lot of times he didn't want to use force," she said.

Rowley appeared in the dock wearing a dark blue suit, denies assault by beating.

The case continues.