Image Dueling campaign posters outside a polling place in San Antonio, Texas. Credit... Scott Olson/Getty Images

Mr. McCain proceeded to offer a preview of attacks for his Democratic rival. “I will leave it to my opponent to propose returning to the failed, big-government mandates of the ’60s and ’70s to address problems such as the lack of health care insurance for some Americans,” he said. “I will campaign to make health care more accessible to more Americans with reforms that will bring down costs in the health care industry without ruining the quality of the world’s best medical care.”

Mrs. Clinton’s twin victories in Ohio and Texas gave her, at the least, a psychological boost after a tough month in which she watched Mr. Obama, of Illinois, roll up victory after victory and build a lead in delegates. There was virtually no chance that Mrs. Clinton could have survived had she lost Ohio and Texas; her husband, former President Bill Clinton, said last month that his wife needed to win both states.

Mrs. Clinton was already planning ways to capitalize on her performance; she was scheduled to appear Wednesday on all the morning news programs. But she will continue to find herself in a difficult position mathematically. Given the way the Democratic party allocates delegates, it remained unclear whether Mrs. Clinton would close Mr. Obama’s lead on that front.

Even before the polls closed, Mr. Obama’s aides said that given their lead in delegates over Mrs. Clinton, it was not possible for her to catch up in the few remaining contests.

Image A polling place at the Eastland Lanes Bowling Alley in Columbus, Ohio. Credit... Matt Sullivan/Reuters

Mr. Obama came out shortly before midnight to speak to a crowd in San Antonio, and laid out the argument his campaign would make in the days ahead.