William P. Barr testifies before a U.S. Senate Judiciary Committee hearing on his nomination to be attorney general of the United States on Capitol Hill in Washington on Jan. 15. (Jonathan Ernst/Reuters)

Attorney general nominee William P. Barr said Tuesday that if confirmed, he would not interfere with the District’s decriminalization of marijuana, giving a boost to advocates who want to fully legalize pot in the nation’s capital.

During his Senate confirmation hearing, Barr suggested that he would return to the Obama-era policy of not enforcing federal law prohibiting the possession and sale of marijuana in states that had legalized it.

Former attorney general Jeff Sessions had reversed that guidance last year.

At the hearing, Sen. Kamala D. Harris (D-Calif.) asked Barr whether he would enforce federal marijuana laws in states that have legalized marijuana — as well as the District.

“To the extent people are complying with the state laws in distribution and production and so forth, we’re not going to go after that,” Barr said.

D.C. Mayor Muriel E. Bowser (D) applauded his statement.

“It is a very positive statement on the part of the U.S. attorney general nominee and we hope that Congress will follow through and lift the unique restriction on Washington, D.C., so that we can have a safe, regulated system for marijuana sales and drive out the illegal market,” said Bowser, who is proposing legislation this year to regulate and tax pot sales.

However, the District has other hurdles to overcome.

Voters in 2014 passed a ballot measure legalizing the possession of marijuana in small amounts, but House Republicans, led by Rep. Andy Harris (R-Md.), blocked the city from spending its own money to tax and regulate marijuana.

District residents over 21 can legally grow and use marijuana, and possess up to two ounces. But it must be used and grown on private property and cannot be exchanged for money.

That has created a gray market of sorts, where businesses are selling goods and including a free “gift” of small amounts of marijuana.

“The underground market is very strong and causing a lot of confusion in our city about what is legal and what is not,” said D.C. Council member David Grosso (I-At Large).

It also means the District loses out on what could be millions of dollars in revenue annually.

Now that Democrats control the House, D.C. advocates are hopeful that the majority will clear the way for the city to make its own marijuana laws.

To do that, the House would have to remove a measure called a rider from the appropriations bill for the District.

The GOP-controlled Senate’s budget probably would still include such a rider, forcing the two chambers to reconcile the bills.

Del. Eleanor Holmes Norton, the city’s nonvoting representative, said, “With a Democratic House, our goal now is to get the D.C. marijuana rider removed during the appropriations process so that D.C., just like states, is allowed to commercialize, free from federal interference.”

Grosso, who has introduced legislation authorizing the city to license recreational pot shops, said moving ahead with a tax and regulation plan would clarify the drug’s status in the District.

“We’re in the same pickle no matter what the executive or administration wants to do if Congress continues to meddle in our local affairs,” he said.