AUGUSTA, Maine — Democrats in the Maine Senate fell five votes short Tuesday in an effort to override Gov. Paul LePage’s veto of a bill that would have barred anyone younger than 18 from using commercial tanning beds.

The Senate voted 19-16 to override LePage’s veto of LD 272, An Act to Reduce Youth Cancer Risk. Twenty-four Senate votes are needed for a successful veto override.

The measure, sponsored by Sen. Geoffrey Gratwick, D-Bangor, passed both the House and Senate in largely party-line votes, with Democrats supporting what they characterized as sound public health policy and Republicans casting it as an example of government overreach.

In vetoing the bill, LePage said the legislation “tells Maine parents that Augusta knows better than they do when it comes to their children.”

Gratwick, a rheumatologist, said on the Senate floor Tuesday, “There are times when science and medicine should most assuredly supersede politics. This is one of them.”

Two senators switched their votes during Tuesday’s override attempt. Democratic Sen. Linda Valentino of Saco supported the override after voting against the tanning ban last week, and Republican Sen. Edward Youngblood of Brewer opposed the override after supporting the bill.

Democratic Sen. John Cleveland of Auburn broke with his party in both votes, opposing the proposed tanning restrictions and the subsequent override attempt.

Tuesday’s override vote marked the second attempt by lawmakers to override a veto by LePage. Last week, senators fell one vote short of overriding LePage’s first veto, on a bill that would require government agencies and businesses to comply with payment agreements they have set up with county registries of deeds.

While LePage has issued two vetoes this legislative session, he planned to issue five in mid-March, submitting veto letters to the clerk of the House and secretary of the Senate before rescinding them. The governor promised at the beginning of March to veto all legislation sent to him before the Legislature took action on his plan to repay Maine’s Medicaid debt to its 39 hospitals.

House Clerk Millicent MacFarland, who has worked in the House clerk’s office in different capacities since 1978, said Tuesday she had never before seen a governor send veto letters to her office then withdraw them.