One of the UK’s top drill artists has appeared in court charged with possession of a loaded gun “small enough to fit into the palm of your hand”.

The rapper Loski, 20, whose real name is Jyrelle O’Connor, has had a string of successful singles and attracts millions of views on YouTube and other social media platforms.

Prosecutor Ken Millett told Croydon crown court on Tuesday that O’Connor, who lives in Gerrards Cross but grew up in Kennington, was a member of a south London gang, the Harlem Spartans, which is involved in a violent dispute with a rival gang known as 4 10 or the Angel Town gang.

He said that despite moving from Kennington to Gerrards Cross O’Connor has maintained contact with gangland figures in south London.

O’Connor has been charged with various offences related to possession of a firearm, one with intent to endanger life, and possession of ammunition.

O’Connor was stopped by police on 9 April 2019 while travelling in an Uber towards Willesden. He had booked the taxi in a false name. The cab was searched and initially nothing was found. But a second search revealed a small loaded revolver in a sock underneath the front passenger seat of the cab.

“This is quite a small gun. You could fit it into the palm of your hand,” Millett told the court.

O’Connor was taken to Sutton police station where he was asked to account for the gun, asked if he was under duress and if he was a gang member. He made no comment.

“We suggest there’s only one reason to possess a loaded firearm of this nature,” said Millett. “It’s not for shooting pigeons or foxes, it’s to enable the possessor to endanger life as and when the occasion arises or for someone else. Why else would you possess a loaded firearm?

“We suggest Mr O’Connor is neither a stranger to firearms. He has a conviction for possessing a shotgun, which was found under his bed in 2015 – a single-barrel shotgun. We suggest he continues to have an interest in firearms. We suggest he’s a leading member of the Harlem Spartans gang and the gun was for use in connection with a continuing gang dispute either by him or another member of the gang.”

He said most of the young men in the Harlem Spartans had grown up in the area, including O’Connor.

“Mr O’Connor is held in high esteem not just because of his prowess in music. We suggest there’s a duality of purpose. The videos that are put out can make a lot of money but also goad and fuel feuds between these gangs. Lyrics often relate to serious incidents that have already taken place. His membership of gang goes to motive.”

Two phones were found after O’Connor was arrested. The court heard O’Connor initially refused to reveal the phones’ pin numbers then revealed the wrong ones but police found a way to download information from the handsets.

The contents of the phones included a video of someone loading and unloading an Uzi machine gun, and a picture of what the prosecution suggested was a handgun with a round of ammunition. Another photo showed a gun, a knife and meat cleaver.

The case continues.