Democratic Rep. Beto O'Rourke, trailing in the polls, went on the attack Tuesday night in a debate with Ted Cruz, calling his Republican rival "dishonest" and reviving Donald Trump's derisive and memorable nickname for the Texas senator.

Borrowing a page from Trump's campaign playbook, O'Rourke dubbed Cruz as "Lyin' Ted" minutes into the hour-long face off.

"This is what you can expect over course of the debate: Senator Cruz won't be honest with you. He's dishonest," O'Rourke said. "It's why the president called him 'Lyin' Ted' and it's why the nickname stuck — because it's true."

Cruz shot back: "It's clear Congressman O'Rourke's pollsters have told him to come out on the attack. If he wants to insult me and call me names, that's fine." But, Cruz went on to note, "facts are stubborn things."

It was the second debate in a hard-fought Senate contest that has become the focus of national attention — O'Rourke recently shattered a fundraising record by hauling in $38 million in a three-month period. Polls show the contest in the reliably red state is still fairly close, with Cruz holding a single-digit lead three weeks from Election Day.

Their meeting in what is likely the final debate was marked by repeated jabs and sharp policy differences from the opening bell. The two clashed over abortion, health care, energy, immigration, the Supreme Court, trade and more.

But it was perhaps most notable for O'Rourke's more aggressive and sometimes personal attacks on Cruz, a much sharper approach than the El Paso-area congressman took in their first debate last month.

"He's all talk and no action," O'Rourke said late in the debate, citing Cruz's vote against a bill to protect women from violence.

O'Rourke repeatedly portrayed his opponent as putting his own interests ahead of Texans, charging that Cruz had missed many votes in the Senate while campaigning across the country for the White House in 2016.

"Ted Cruz has put his career above the interests and priorities of Texas. Ted Cruz is for Ted Cruz," O'Rourke said.

Cruz got in plenty of shots of his own, calling his opponent "extreme" on immigration and charging that O'Rourke not only opposed building a border wall but also wanted to tear down existing fences and barriers. The Republican also charged O'Rourke had opposed law enforcement his entire career in public life.

Cruz said O'Rourke still "goes with the left-wing national activists and left-wing national donors."

Cruz said he wants to work with Trump on trade policy and other issues, and noted O'Rourke is the only Democrat running for Senate in the country who has called for the president's impeachment, a statement O'Rourke did not dispute. Cruz told the audience that mattered because if O’Rourke wins, there will be "two years of a partisan circus and a witch hunt on the president."

"Really interesting to hear you talk about a partisan circus after your six years in the U.S. Senate," O'Rourke replied, to laughter from the audience.

During one of the final moments of the debate, Cruz elicited groans from the audience when he snapped at reporter Jason Whitely, one of the debate's moderators, for trying to ask a follow-up to a question about the lack of civility in public life.

"Don't interrupt me, Jason," Cruz said.

Trump is coming to Texas on Monday to campaign on behalf of Cruz at a rally in Houston.

On Wednesday, the president tweeted that he had watched the debate and called O'Rourke a "flake."

Watched the debate last night & Beto O’Rourke, who wants higher taxes and far more regulations, is not in the same league with Ted Cruz & what the great people of Texas stand for & want. Ted is strong on Crime, Border & 2nd A, loves our Military, Vets, Low Taxes. Beto is a Flake! — Donald J. Trump (@realDonaldTrump) October 17, 2018

The debate was hosted at at the studio of KENS-5, a CBS affiliate in San Antonio, and the candidates answered questions from two of the network's reporters.