The Maryland Senate on Monday night passed a bill to require president and vice presidential candidates to release their tax returns if they wish to appear on the state's ballots.

The move, a direct assault on President Donald Trump, drew harsh criticism from Republicans and some Democrats.

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

The chamber voted 28-17 to pass the measure, meaning it got the support of all but four Democrats — Brochin, Sen. James DeGrange, Sen. Katherine Klausmeier and Sen. James Mathias.

The bill passed despite two attempts, from Brochin and Minority Whip Stephen Hershey, to delay a vote to a later date. Senate President Thomas V. Mike Miller rejected both.

“This is the most childish bill that I’ve ever seen and I’m embarrassed that it’s on the floor,” Hershey said.

Sen. Paul Pinsky, a Prince George’s County Democrat, rejected criticisms from colleagues that, if passed, the law would not stand up to legal challenge. He said an assistant attorney general advised that it was “not clearly unconstitutional.”

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

Maryland would be the first state to enact such a law, which would require candidates to share tax returns going back at least five years. The governors of California and New Jersey vetoed similar measures.

Trump has faced widespread criticism from Democrats for refusing to release his tax returns. He is one of only two major-party candidates to do so in the past 40 years, along with President Gerald Ford in 1976, according to Politifact.