The prosecutor, Gillian Kassner, said the rapper used at least six aliases and posed a risk of fleeing the country — “not to mention,” she said, “the alias he most commonly uses actually refers to leaving,” a nod to his stage name, Pop Smoke.

Pop Smoke responded softly to the judge’s questions, wearing a white hoodie with Mona Lisa’s face on the front and striped green velour sweatpants. He was released on a $250,000 bond and is prohibited from traveling outside the United States without the government’s permission.

He is also barred from any contact with gang members or with the owner of the Rolls-Royce.

Mark I. Cohen, a lawyer for Pop Smoke, declined to comment after the hearing.

With radio staples like “Welcome to the Party” and “Dior,” the gravel-voiced Pop Smoke became one of the most promising rappers from Brooklyn’s growing drill rap scene last year. His debut EP, “Meet the Woo,” was released last July.

In October, Pop Smoke was one of five New York rappers that the New York Police Department prevented from performing at the Rolling Loud hip-hop festival in Queens, contending that they had been “affiliated with recent acts of violence citywide” but not specifying any criminal behavior.

A month later, he met the owner of the new Rolls-Royce at a recording studio in Los Angeles. The owner, whose identity was not revealed in the indictment, let the rapper borrow his car for a music video on the promise that it would be returned the day after, according to the law enforcement official.

When that day came, the official said, the owner was unable to reach Pop Smoke and tried figuring out the Rolls-Royce’s location using the GPS tracking on the car. He saw that his Rolls-Royce was traveling through Arizona.