Updated

Oakland Athletics pitcher Brandon McCarthy was released from a Bay Area hospital on Tuesday, less than a week after getting hit in the head by a line drive and undergoing surgery.

And he said he plans to return to baseball once he returns to full strength in the coming months.

The A's say Dr. Peter Weber, the neurologist who performed the surgery at California Pacific Medical Center in San Francisco, and team physician Dr. Allan Pont agreed "McCarthy had made an excellent recovery and could be safely released from the hospital."

The 29-year-old McCarthy underwent two hours of surgery late Wednesday after a ball hit by the Angels' Erick Aybar struck the right side of his head. He experienced an epidural hemorrhage, brain contusion and skull fracture on the play.

McCarthy expressed deep appreciation to everyone involved in his care, from the moment of the accident to the ambulance ride and doctors and nurses who checked on him around the clock at the hospital.

"From the bottom of our hearts, (my wife) Amanda and I want to thank everyone who was involved in responding to and treating my injury," McCarthy said in a statement released by the A's. "We could not have been in better hands."

The A's said that McCarthy will remain in the Bay Area for the next three weeks.

By Saturday, he was back to joking on Twitter — and his wife was posting regularly, too.

McCarthy, Oakland's opening day starter, is 8-6 with a 3.24 ERA this year in his sixth big league season and second with the A's. He went 9-9 with a 3.32 ERA last season.

"We also want to express our deep appreciation to our teammates, manager and coaching staff for their concern and encouragement during the uncertain times, and also want to thank all the A's fans who wished us well," McCarthy said. "It's times like these when you realize you have an extended family, and feel so fortunate. Now we look forward to continuing the healing process, and returning to baseball and our normal lives in the weeks and months ahead. Go A's!"

Oakland was scheduled for a night road game in Anaheim against the Angels.