By John Whitesides

(Reuters) - Texas Democratic U.S. Senate contender Beto O'Rourke, slipping in the polls despite a record fundraising haul, went on the attack in a raucous debate with Republican rival Ted Cruz on Tuesday and resurrected the senator's nickname of "Lyin Ted."

O'Rourke and Cruz clashed repeatedly on divisive issues such as abortion, immigration and the possible impeachment of President Donald Trump, and O'Rourke bitterly accused Cruz of being "dishonest" and misrepresenting his positions.

"Senator Cruz is not going to be honest with you. He is going to make up positions and votes that I’ve never held," O'Rourke said during the debate in a San Antonio television studio.

O'Rourke resurrected the nickname given Cruz by Trump during the 2016 presidential campaign. "He's dishonest," he said. "It’s why the president called him ‘Lyin’ Ted,’and why the nickname stuck.”

Cruz took note of the more aggressive posture from O'Rourke, who had been hesitant to attack Cruz while portraying himself as a unifying figure who could bring Texans together, and made reference to O'Rourke's declining standing in the polls.

"It's clear Congressman O'Rourke's pollsters have told him to come out on the attack," Cruz said.

The race in Texas is seen as one of the Democrats' best shots at picking up one of the two U.S. Senate seats it needs to give the party a majority in the Senate and allow it to block Trump's agenda and exercise oversight of his administration.

Tuesday's debate, the second between the two Senate contenders and the last scheduled before the Nov. 6 election, comes at a critical time. Early voting starts in Texas in six days, and recent polls show O'Rourke slipping further behind in conservative Texas, which has not elected a Democrat to statewide office since 1994.

A poll average compiled by Real Clear Politics gave Cruz a lead of 7 percentage points, and a new CNN poll published on Tuesday gave Cruz a similar 7-point margin.

Story continues

O'Rourke's uphill campaign has attracted grassroots enthusiasm and a flood of financial donations. O'Rourke set a Senate record for a single three-month period with $38 million in third-quarter donations, more than triple the haul for Cruz.

But Cruz has made headway by hammering O'Rourke as out of step with Texas voters because he backs a path to citizenship for illegal immigrants, opposes building a wall along the U.S.-Mexican border, and supports some gun-control measures.

He continued those attacks during the debate, saying O'Rourke had repeatedly showed his willingness to align himself with the Democrats' liberal wing over the needs of Texans.

"Every time there is a choice between left-wing national activists and the people of Texas, he goes with left-wing national activists," Cruz said.

Cruz accused O’Rourke of being eager to bring impeachment proceedings against Trump, contending that a Democratic Senate would provoke “two years of a partisan circus.”

O’Rourke shot back: "It’s really interesting to hear you talk about a partisan circus after your last six years in the U.S. Senate."

Cruz, who challenged Trump unsuccessfully for the Republican presidential nomination in 2016, will get help from his former rival next week when Trump headlines a Houston campaign rally for Cruz and other Texas Republicans.

(Reporting by John Whitesides in Washington; Editing by Peter Cooney)