Virginia Gov. Terry McAuliffe (D), right, reviews legislation with his staff last year that he either signed or vetoed. McAuliffe is on track to break the record for the most vetoes in Virginia history. (Bob Brown/AP)

Gov. Terry McAuliffe has vetoed more bills than any governor in Virginia history, a testament to the ideological gap between the Democratic chief executive and the ­Republican-controlled legislature at a time of increasingly partisan tensions in national ­politics.

Since taking office in 2013, McAuliffe has vetoed 91 bills — eclipsing the record held by former governor Jim Gilmore (R). McAuliffe broke that record Thursday morning when he vetoed two bills that would have insulated any person or organization that declined to perfrom a same-sex marriage from civil penalties.

The stalemate between the governor and lawmakers is a central feature of this year’s race to succeed McAuliffe, who is prohibited by the state constitution from serving a second consecutive term.

If Virginians elect another Democrat, they’ll probably get four more years of legislative tension. A Republican chief executive could take the state in a very different direction.

All 100 seats in the House of Delegates are up for election this year, but Republicans enjoy such a comfortable majority — 66 to 34 — that they aren’t likely to lose it. There are no elections this year in the state Senate, which has a 21 to 19 Republican edge.

So it’s the governor’s race that holds the key to how certain issues such as gun rights, public funding for abortion, and immigration enforcement play out over the next four years.

“We need a backstop here to protect individual rights,” McAuliffe said in an interview. He warned the General Assembly at the opening of this year’s session that he would veto certain social-issue bills — and reminded them that he has the votes to sustain the vetoes.

Accordingly, some topics never made it to his desk, such as a bill that would have required people to use the public restrooms that conform to the genders on their birth certificates.

[Republican-led committee kills transgender ‘bathroom bill’]

At the same time, has signed far more than he has vetoed, about 3,000 pieces of legislation over the course of his term.

Of the 880 bills that landed on his desk this year, he has signed 671 but vetoed 18: cutting support for Planned Parenthood, imposing more requirements on voter registration, restricting absentee voting and expanding access to handguns. Most of those he had promised to veto or had vetoed similar measures.

In McAuliffe’s view, he is the last bulwark against a more conservative social agenda. He called himself a “brick wall” in announcing the Planned Parenthood veto. Democratic gubernatorial candidates Lt. Gov. Ralph Northam and former congressman Tom Perriello have appropriated the phrase on the campaign trail.

McAuliffe casts it in terms of economic development, which has been the biggest theme of his term. He uses North Carolina as a bugaboo, warning that its recent conservative social laws cost the state jobs and business ­opportunities. citing the jobs and opportunities lost when that state passed bathroom-gender legislation.

On a recent trip to California, he said, tech companies expressed concern that Virginia had even debated a topic such as the bathroom bill.

“I don’t relish doing it,” he said of his veto power. “If I could be sitting here today and had not vetoed any bills, economy booming and so forth, I’d be happy.”

Across the aisle, though, Republican legislators accuse the governor of grandstanding on issues that he could have worked to resolve.

“We don’t see him a whole lot during the session,” said Del. M. Kirkland Cox (R-Colonial Heights), who is in line to take over as speaker of the House when Speaker William J. Howell (R-Stafford) retires next year.

“Key bills come up and there’s really no one from the administration to comment on them,” he said. Rather than try to find common ground, McAuliffe seems to prefer making a show of vetoing bills to score political points, Cox said.

Cox also argued that many of the vetoed bills are not as extreme as McAuliffe suggests. One measure lowered the age at which someone on active duty in the military could apply for a concealed-weapons permit, from 21 to 18. Another bill would have prohibited employees of a franchisee, such as a fast-food restaurant, from being considered employees of the franchiser — the parent company, such as Wendy’s or McDonald’s.

“You can disagree with that,” Cox said, “but I wouldn’t think the average person would go, ‘That’s an over-the-top piece of legislation.’ . . . I don’t see them as bills that are out of the mainstream.”

Sen. Ryan T. McDougle (R-Hanover) also faulted McAuliffe for, in past years, staging a budget showdown with the General Assembly over Medicaid expansion.

“If you want to do what’s best for Virginia, you would pick a Republican governor who’s not going to take the state to the brink of a shutdown on the budget because they have a political agenda in play,” he said.

And the three candidates vying for the Republican nomination make that very argument.

“He is less concerned about the welfare of Virginia and its citizens than he is about his own political career,” said Prince William County Supervisor Corey Stewart, who is competing with former Republican National Committee chairman Ed Gillespie and state Sen. Frank W. Wagner (Virginia Beach) to be the Republican ­nominee.

Stewart said he would have signed a tax credit for coal companies and a measure allowing home-schooled children to participate in sports in public schools, known as the Tebow bill.

“Whether it’s the coal tax credit, the Tebow bill, or education choice legislation, I’ve never seen a governor so proud of everything he didn’t get done for the Commonwealth,” Gillespie said via email.

There was pragmatism about the situation in this year’s General Assembly session. Del. David B. Albo (R-Fairfax), chairman of the Courts of Justice Committee, shelved a number of bills with the unusually frank explanation that they either were too liberal for the legislature or too conservative for the governor.

[Existential debate of lawmaking: If it’s doomed anyway, why take it up?]

And other parts of the process have been far from paralyzed. The governor and legislators worked together to close shortfalls in the state budget, for instance, and to get raises for state employees.

“We’ve had a good working relationship with the General Assembly on economic development issues, on transportation issues, education issues — great working relationship,” McAuliffe said. “We have not seen eye-to-eye on social pieces of legislation.”