The shuttle undocked from the International Space Station at about 4 a.m. for the last time.
Shatner, best known for playing Capt. Kirk on the original "Star Trek" TV series, recorded a message for the crew in the style of the "Star Trek" TV series theme.
"Space, the final frontier," Shatner said. "These have been the voyages of the space shuttle Discovery. Her 30-year mission: to seek out new science, to build new outposts, to bring nations together on the final frontier, to boldly go and do what no spacecraft has done before."
Station skipper Scott Kelly rang his ship's bell in true naval tradition, as the shuttle backed away on the final leg of its final journey.
"Discovery departing," he called out.
Discovery is due back on Earth on Wednesday. The crew of six astronauts spent more than a week at the station, installing a new storage unit and equipment platform.
The shuttle is being retired after touchdown and sent to the Smithsonian Institution for display. NASA's two other shuttles will join Discovery in retirement, following their upcoming missions.
Discovery will have racked up nearly 150 million miles by trip's end, accumulated over 39 missions and nearly 27 years, and spent 365 days total in space. It flew to the space station 13 times.
The Associated Press contributed to this story.