Jeff Gluck

USA TODAY Sports

FONTANA, Calif. — Denny Hamlin was released from a local hospital Sunday night after undergoing tests for a sinus infection that affected his vision.

Joe Gibbs Racing said in a statement Hamlin would be further evaluated this week in Charlotte after missing Sunday's Auto Club 400 due to illness.

The decision for Hamlin to skip the race was made just 70 minutes before the green flag, when it was determined Hamlin couldn't see well enough to drive. Sam Hornish Jr., who was in Fontana on standby for expectant father Matt Kenseth, replaced Hamlin and finished 17th.

Hamlin expressed some concerns about his vision in relation to the sinus infection, Joe Gibbs Racing president J.D. Gibbs said prior to the race. NASCAR didn't medically clear Hamlin to race within 45 minutes of the start time, and he was transported to a hospital for further evaluation. Doctors also advised Hamlin he should not take the wheel.

"(Hamlin) has a sinus infection, and it's affecting his vision, so he won't be able to start the race today," said Gibbs, who indicated that the sinus problems probably began Friday. "So we hate it for him. He's been so good for us and JGR over the years. We're just praying he has a quick recovery. Hopefully they'll take him to the hospital, do the scan and be able to come home real soon."

Crew chief Darian Grubb told NASCAR.com and MRN.com that the symptoms had gotten worse as the day progressed, according to the Associated Press.

"It's not just a headache. It's a lot more serious than that. He was actually losing vision (in) his eye," Grubb told MRN.com and NASCAR.com after Sunday's race.

Before Hamlin was released from the hospital, Grubb told the outlets:

"The last I'd heard, his vision was getting worse and the pain was getting worse. It got to where he couldn't see and was having trouble with the vision in his left eye because of the pressure and everything that was going on. At that point, NASCAR did some testing and he could not follow the finger going by his eyes as he should have been.

"They weren't going to let him go."

According to the Associated Press, Hamlin wore dark sunglasses in the indoor driver meeting two hours before the race.

"He held his head and said his head was hurting so bad. He was having trouble seeing," Grubb said. "You could tell the worry in his face, he was really upset."

This is the second year in a row Hamlin has had to make a trip to the hospital in Southern California. Last year, he required hospitalization after breaking his back in a last-lap crash with Joey Logano.

Hamlin tweeted: "So disappointed that I can't compete today. Sorry to all my fans. Thought we had a car that could win today. Good luck to @SamHornish"

Hornish said he was chatting with former boss Roger Penske when his phone started buzzing with calls and a text from crew chief Darian Grubb which asked him to come to the No. 11 hauler immediately.

Though he had experience doing fill-in duty at the last minute -- Hornish filled in for AJ Allmendinger after the latter driver was suspended for failing a NASCAR drug test. in July 2012 -- Hornish had no expectation of racing Sunday.

"I figured there was no way I was getting in a car today," he said. "I was probably not as well-hydrated and well-fed as I would have been if I'd known I was getting in the car."

Hornish said he drove 400 miles hunched over -- his shoulders were wider than the dimensions of Hamlin's seat -- and fought arm cramps with a steering wheel that was too close to his chest.

Still, he managed to finish 17th despite getting bumped by Paul Menard while running close to the top 10.

Hornish, who will drive a limited schedule for JGR in the NASCAR Nationwide Series, was making his first Sprint Cup start since last April's Kansas Speedway race.

Hamlin's issue will not affect his eligibility for the Chase for the Sprint Cup. Drivers are only required to make an attempt to qualify for the race — not start it — and Hamlin did that on Friday.

Follow Gluck on Twitter @jeff_gluck