Republican presidential candidate Mitt Romney pledged during the first presidential debate Wednesday night that he would be able to work across party lines and push Congress do legislate more effectively.

President Obama countered by casting doubt on that pledge, saying Romney has not shown himself capable of fending off "extreme" elements of the Republican Party.

Moderator Jim Lehrer ended the debate in Denver by asking what either would do to counteract the intensely partisan politics that have defined Washington for the last two years. Romney responded that he had the ability to work with a mostly Democratic legislature while governor of Massachusetts and said he could work that way again if elected president.

"As president, I will sit down on day one — actually, the day after I get elected — I'll sit down with leaders, the Democratic leaders as well as Republican leaders, and continue as we did in my state," Romney said. "We have to work on a collaborative basis, not because we're going to compromise our principle, but because there's common ground.

"Republicans and Democrats both love America, but we need to have leadership," Romney added. "Leadership in Washington that will actually bring people together and get the job done and could not care less if it's a Republican or a Democrat. I've done it before, I'll do it again."

Obama replied by saying Romney would immediately get off on the wrong foot with Democrats because he has pledged to repeal the 2010 healthcare law.

"I think Gov. Romney's going to have a busy first day because he's also going to repeal ObamaCare, which will not be very popular among Democrats as you're sitting down with them," Obama said.

Obama said he has continued to operate as president by taking ideas from both political parties, "as long as they're advancing the cause of making middle-class families stronger and giving ladders of opportunity to the middle class."

Obama also argued that part of being a leader is being able to describe exactly what you want to accomplish, and said Romney has failed to provide those details on many issues so far. But Obama also said leadership also means saying "no," and said he doubted Romney could reject the positions of far-right Republicans.

"I've got to tell you, Gov. Romney, when it comes to his own party during the course of this campaign, has not displayed that willingness to say no to some of the more extreme parts of his party."