The state Senate of Maryland has passed a bill requiring presidential candidates to publicly release their tax returns in order to appear on the state’s ballot.

The bill, which passed through the Democrat-controlled state Senate by 28-17, requires both presidential and vice-presidential candidates to release their tax for the past five years to participate.

The legislation is widely seen as targeting President Donald Trump, who refused to release his tax returns during the 2016 presidential campaign. Yet the move has already attracted bipartisan condemnation, with critics describing it as childish and unconstitutional.

“This is the most childish bill that I’ve ever seen and I’m embarrassed that it’s on the floor,” the Senate Minority Whip Stephen Hershey (R), was quoted as saying.

“Show me in the Constitution where it says that’s a qualification for being President of the United States,” added Baltimore County’s Sen. James Brochin (D).“We can’t go along and make up rules when we don’t like the President of the United States.”

However, Sen. Paul Pinsky (D) pointed to the fact that such a law had not been legally tested and claimed the state’s assistant attorney general advised that it was “not clearly unconstitutional.”

“She equivocated, OK? This has not been tested in the courts,” he said.

Similar bills have previously passed the Senate in both New Jersey and California, although in both instances the bills were vetoed.

If signed into law, Maryland would become the first state to pass such legislation. Gov. Larry Hogan (R) is yet to comment on whether he will sign it into law.

Follow Ben Kew on Facebook, Twitter at @ben_kew, or email him at bkew@breitbart.com.