(CNN) -- Champion cyclist Lance Armstrong will have surgery Wednesday to repair a broken collarbone he suffered in a fall during a comeback race in Spain this week, he said via Twitter.
American Armstrong was competing in Spain to regain full race fitness after coming out of retirement.
"At home finally. Whew. Long coupla days. Surgery at 7am tomorrow," he wrote, or tweeted -- as sending short messages on the Web site is known -- Tuesday evening from Austin, Texas, where he lives.
Armstrong chronicled his day in a series of Twitter messages.
"Back in the good ol' U S of A."
"Back in austin. Headed to the doctor's office."
"At the doc's office. I guess it wasn't such a 'clean' fracture after all. Bummer."
"Getting a CT scan now."
Emerging from a hospital with his arm in a sling Monday, Armstrong said he was "miserable."
"I just need to relax a couple of days and then make a plan," he said.
Armstrong, riding for Team Astana, crashed about 10 miles (16 kilometers) from the end of the first stage of the five-day Vuelta Ciclista a Castilla y Leon race. He said he has never before broken a collarbone in his 17 years as professional.
"It's pretty painful," he said. "Just wait and see how it heals."
The crash took down several riders, but Armstrong appeared to be the only one injured.
"That's cycling," he said. "It's nobody's fault. Crashes happen all the time."
As they came within a few miles of the finish, Armstrong said, racers started picking up speed and jockeying for position. Watch more about the crash »
"It happens quick when it happens," he said. "It could have been worse."
Armstrong, 37, announced that he was coming out of retirement last year and was using the Spanish race as a warm-up for the Tour de France.
He could be out for three or four weeks because of the collarbone injury, said Jacinto Vidarte, spokesman for the five-day Spanish race.
Armstrong, who is attempting a second comeback after retiring in 2005, was planning to race May 9-31 in the Giro d'Italia, one of Europe's most prestigious and grueling stage races. He said Monday that his plans for racing in the Giro were now "problematic."
His first comeback came in 1998, two years after he was diagnosed with advanced testicular cancer that had spread to his lungs and brain. Doctors gave him a less than 50 percent chance of survival.
-- CNN Madrid Bureau Chief Al Goodman contributed to this report.