Presidential candidates — including President Trump if he runs for reelection — would have to publicly release their federal income tax returns to be on the ballot in Maryland, under a bill that received an initial nod from the state Senate on Thursday.

The preliminary approval followed a long debate that largely centered around the 45th president.

“For 40 years in the United States, every presidential candidate has done this until 15 months ago,” bill sponsor Sen. Paul G. Pinsky (D-Prince George’s) said of releasing tax returns. “People have come to expect this kind of information. Voters want to know before a name appears on the ballot.”

Opponents of the bill described it as a partisan shot aimed at Trump, who has refused to release his returns.

Pinsky, however, said the legislation is directed at anyone who wants to hold the office of president. “Donald Trump may have caused it,” Pinsky said. “But it’s not aimed at Donald Trump . . . . This is prospective. It is not retroactive.”

Maryland is the latest state to consider the requirement. Legislatures in California and New Jersey passed similar bills last year, but governors in those states vetoed the measures over constitutional concerns.

Under the Maryland bill, presidential and vice-presidential candidates would have to submit five years of their federal income taxes to the State Board of Elections no later than 65 days before voters go to the polls.

Several proposed amendments failed, including that would have required all state elected officials and legislators to disclose their federal returns. Another would have required state lawmakers to disclose state income tax returns.

“What’s good for the goose is good for the gander,” Sen. Justin D. Ready (R-Carroll) said.

Pinsky, who opposed the amendments, said state lawmakers do not have the same role as the president. The bill, he said, allows voters to be able to see any “economic entanglements, foreign and domestic” for the person who “has an impact on our nation’s economy.”

But Sen. Michael J. Hough (R-Frederick) compared the Maryland bill to a bill passed in Arizona in 2011 that required presidential candidates to prove they are U.S. citizens.

That measure was seen as an attack on then-President Barack Obama. “What Arizona did to Obama was wrong,” Hough said describing it as a “shameful partisan embarrassment.”

He said Pinsky’s bill was no different. The bill is scheduled for final approval in the Senate on Friday.

Also on Thursday, the Senate gave final approval to a bill that stiffens the penalties for those who commit cyberbullying against a child.

Under certain circumstances, a person could face a misdemeanor charge.

The Senate also gave final approval to a bill pushed by Gov. Larry Hogan (R) that increases the penalties for repeat drunk drivers.