The Maryland Senate on Wednesday passed a bill to prohibit smoking in cars when a child younger than 8 is a passenger.

If the bill clears the House of Delegates, Maryland will join a handful of states that have enacted similar laws. Violators in Maryland would face a fine of up to $50.

The 27 to 19 vote ended a debate that was as long as any other this session despite an agenda crowded with many higher-profile initiatives.

The debate hinged on differing views of the proper role of government and police, with many Republicans blasting the bill as an invasion into the “sanctity” of people’s privacy and an unwarranted expansion of police power.

“I stand in opposition to this bill, because it almost tries to say that the government cares more about children than their parents,” said Sen. Edward R. Reilly (R-Anne Arundel).

Reilly said the law would ask police to “intrude” into people’s lives. “They have enough to do. They don’t have to be policing people’s health,” he said.

Several detractors warned that the bill would spur government regulations of other private behaviors, such as smoking at home or feeding children unhealthful food.

“Cheeseburgers are next, because after all, they’re not healthy for kids,” said Sen. E.J. Pipkin (R-Queen Anne’s).

Sen. John C. Astle (D-Anne Arundel) invoked “Nineteen Eighty-Four,” a novel in which the character Big Brother represents totalitarian government. “Some of the actions that we take here look like we’re moving in that direction,” Astle said.

But supporters, including most Democrats, said government has a responsibility to protect children from secondhand smoke in cars, where they can’t escape exposure.

“This isn’t about Big Brother. It’s about little brother in the back seat,” said Sen. Jamie Raskin (D-Montgomery).

“If we do nothing, we are, by taking no action, by our inaction, condoning threatening the life of young people who have no voice,” said Sen. Paul G. Pinsky (D-Prince George’s). “I believe this is the ultimate, or one of the ultimate, pro-life bills.”

Supporters said that limiting the protection to children younger than 8, who under Maryland law must use car seats, would allow police to spot violators and enforce the law more easily.

Arkansas, California, Hawaii, Louisiana and Maine have similar laws, although in those states, the protection extends to passengers in their teenage years.

“We have the most closely tailored bill . . . precisely in response to those who say we don’t want this to be a roving license for the police to just stop anybody. You’ve got to have a kid in a car seat,” Raskin said.

Similar bills have been introduced each year since 2007. Until this year, however, none has received a favorable committee report and come before the full legislature for a vote

Maryland’s Clean Indoor Air Act of 2007 banned smoking in restaurants, bars and other indoor places open to the public.