RICHMOND — Those convicted of any of 15 capital crimes should have to serve life in prison, eliminating the discretion of a judge in favor of a mandatory minimum sentence, under legislation passed Wednesday by the Virginia Senate on a party-line vote.

The bill calls for life in prison for anyone over the age of 18 convicted of premeditated murder of a police officer, fire marshal or their deputies; judges; an abduction victim; a pregnant woman with the intent to kill the fetus; someone under the age of 14; and 10 other capital crimes, including premeditated murder for hire.

Sen. Mark D. Obenshain (R-Harrisonburg) said that if legislators do not believe those crimes deserve life in prison or a death penalty, then they should be removed from the list of capital crimes, which he called “reprehensible offenses.”

But several Northern Virginia Democrats pushed back on his argument, saying the legislature should trust judges.

Sen. Scott A. Surovell (D-Mount Vernon), a trial lawyer, noted that most criminal cases are resolved by plea bargaining “because of bills like this. This bill puts so much pressure on people to confess. . . . It overly empowers prosecutors.”

Senate Minority Leader Richard L. Saslaw (D-Fairfax) said that he has no problem with capital punishment, but “all the judges I’ve met say, don’t give us more mandatory sentences. I’m not saying these people shouldn’t get long prison sentences, but that’s why we have judges.”

In the past 15 years, more than 30 states have reformed or repealed their mandatory-minimum laws, said Molly Gill, vice president of policy at the Washington-based advocacy group FAMM, formerly known as Families Against Mandatory Minimums.

“These sentences cost a lot of money, and also there’s the awareness that these sentences produce unjust results,” she said. “I would tell the state to prepare to spend a lot of money in the coming years on old, sick prisoners.”

The bill, sponsored by Del. Todd E. Pillion (R-Dickenson), earlier passed the House unanimously as part of a block of bills. It now goes to Gov. Ralph Northam (D) for his signature.

The Senate, again on a party-line vote of 21-19, also passed a bill to bar the governor or any state agency from participating in the Regional Greenhouse Gas Initiative. Nine Northeastern and Mid-Atlantic states participate in the market-based carbon cap-and-trade program.

The bill is similar to one vetoed last year by Northam, except that the earlier version required a majority of the General Assembly to approve any initiative. The 2019 bill calls for a two-thirds majority vote from each chamber before any participation can take place. Supporters said Virginia is doing fine at reducing its greenhouse gas emissions without joining a regional consortium that and states that regulate cap-and-trade have higher energy prices.

During earlier House debate, Del. Alfonso H. Lopez (D-Arlington) called Virginia “ground zero for sea-level rise. This is a climate crisis, with consistent floods in every corner of the state especially on the coast.”