The hearing Thursday in Prince William County Circuit Court was expected to be a quick, perfunctory matter to appoint a lawyer for Joaquin S. Rams of Manassas.

That didn’t happen.

Instead, a surprising turn of events left Rams, who has been charged with capital murder in the death of his 15-month-old son in October, without a lawyer for at least a month.

Rams, 41, was indicted on capital murder recently in the “willful, deliberate and premeditated killing” of someone younger than 14. If convicted, he could face the death penalty.

Authorities say Rams took out more than $500,000 in life insurance on his son, Prince McLeod Rams, before drowning the boy in a bathtub. Prince was the subject of a custody dispute and died during a court-ordered visit with his father.

Rams’s attorney has said that the boy was ill and that Rams rushed him to the bathtub and splashed water on him to quell a fever-induced seizure.

At Thursday’s hearing, Circuit Court Judge Craig D. Johnston was prepared to appoint Edward Ungvarsky of the Northern Virginia Capital Defender Office in the case. Ungvarsky didn’t take the seat next to Rams at the defense table but stood near the podium, ready to address the court.

Then Rams raised his hand.

Speaking clearly and softly, Rams told the judge that he wanted to be represented by Mark Petrovich, a Fairfax criminal defense lawyer who has represented D.C. sniper Lee Boyd Malvo as well as Mark E. Lawlor, who was sentenced to death for the 2008 murder of a woman in Fairfax County.

“I just don’t feel comfortable with the representation,” Rams said, likely referring to Ungvarsky. “I just feel they will serve my defense . . .

Johnston cut him off. “The gravity [in this case] is considerably greater than most cases . . . I am required to appoint in a certain fashion off a certain list,” the judge said.

Petrovich is on a list of about 30 lawyers qualified to try a capital case, Johnston said.

“Mr. Ungvarsky is available, and I think he’ll be a vigorous defender on your behalf,” Johnston said.

Ungvarsky said he wanted to speak with Rams about the situation. The trial shouldn’t be clouded by a potential problem from the get-go, he told the judge.

“I am now hesitant to tell you I’m available to take the case,” Ungvarsky said.

Rams raised his hand again. There was no lawyer sitting next to him to advise him on what to say.

“You do not have counsel now,” Johnston warned him. “The commonwealth’s attorney is listening and taking notes.”

“Can I still address your honor?” Rams asked. “If you can allow me.”

He then requested that Timothy Olmstead, who represented him until the capital murder charge was brought, also be appointed to the team.

Johnston said Olmstead might not be qualified. In the end, Commonwealth’s Attorney Paul B. Ebert (D) agreed to set an Aug. 13 hearing to settle the issue.

Olmstead said the hearing was surprising, but declined to comment further.

Ebert said after the hearing that he has seen defendants ask for specific lawyers before. He would not be surprised, he said, if lawyers were visiting Rams to offer their services. Capital cases can be lucrative and receive media exposure. The budget and associated compensation can climb as high as $500,000, Ebert said. Defense lawyers “travel all over the country, all over the world at the government’s expense,” he said.

Petrovich did not immediately return a call Thursday seeking comment.

Earlier in the hearing, prosecutors dropped the original murder charge against Rams so the court could proceed on the capital murder offense, once a defense lawyer is appointed.