Getty/TMZ

William Shatner -- who played the iconic role of Captain Kirk on "Star Trek" -- was rushed to the hospital Wednesday after suffering a medical emergency, TMZ has learned.

The legendary actor experienced an issue with his blood sugar while at his home in Los Angeles late Wednesday afternoon, according to sources with direct knowledge. TMZ.com

We're told Shatner called emergency medical service workers for help as a precaution and paramedics showed up in an LAFD ambulance.

Our sources say Shatner was transported to a local hospital to get checked out. We're told he's doing "good" and "resting comfortably." TMZ.com

Meanwhile, the 94-year-old Shatner has been keeping a busy schedule lately despite his age, making public appearances and working on projects tied to his Cap

See Full Page