WASHINGTON — U.S. Sen. Ted Cruz on Tuesday night sparred over the future of the Affordable Care Act in a nationally televised debate with, perhaps, his most perfect counterpart in the U.S. Senate: Bernie Sanders of Vermont.

“Should Congress move swiftly to repeal Obamacare? Absolutely,” Cruz said during the debate, hosted by CNN, while Sanders repeatedly called for “Medicare for all.”

As he did during his presidential campaign, Cruz laid out methodical criticisms of President Obama’s signature health law and of the costs associated with Sanders’ plan to expand the government’s role in health care.

But he was less clear about how he would replace the law upon repeal — a problem that is currently bedeviling his colleagues on Capitol Hill. Moderators Jake Tapper and Dana Bash repeatedly pressed Cruz to clarify his proscribed policy solutions.

The Texas Tribune thanks its sponsors. Become one.

Cruz ultimately suggested the tenets of replacement would include industry reforms, purchasing health care over state lines and expanding health savings accounts.

Overall, though, Cruz’s position in the two-hour debate boiled down to his argument that a freer market would lower costs and reduce health insurance premiums.

“What is a right? It’s access to health care,” Cruz said.

“Access does not mean a damn thing,” Sanders fired back. “What it means is whether people can afford it, can afford to get the health care what they need.”

While the debate was at times spirited and sometimes sarcastic, the most dramatic moments came from the town hall-style questioners.

LaRonda Hunter, a Cruz constituent and a Fort Worth hair salon chain owner, explained to Sanders how she is resisting expanding her business in order to avoid requirements to offer employees health care.

The Texas Tribune thanks its sponsors. Become one.

“Let me give you an answer that you will not be happy with,” Sanders said. “I’m sorry, I think that in America today everybody should have health care, and if you have more than 50 people [employed], you know what? I think, I’m afraid to tell you, but I think you will have to provide health insurance.”

Cruz faced a former constituent who left Texas to obtain Medicaid services in Maryland to combat her multiple sclerosis symptoms.

Cruz responded with a criticism of Medicaid and reinforced his argument that lowered costs would increase access to health insurance.

In other moments, the tone was facetious. Sanders coaxed Cruz to support his “Medicare for all” plan, while Cruz responded to a critique about the future of Medicare from his 75-year-old opponent with, “Apparently, I’ve now tried to kill the elderly.”

The CNN presentation had the air at times of a presidential debate — familiar territory for the two men who were both runners-up for their respective major-party nominations in 2016. The two senators at times stood behind podiums, committed to ground rules and made opening and closing statements.

That setting was a return to comfortable territory for Cruz, a debater since grade school, after a rocky political stretch following his withdrawal from the presidential campaign.