Williams was selected as an astronaut in 1998 and has spent 322 days in space over the course of two missions, including one in which she was the commander of the International Space Station.
For the past seven years, NASA astronauts have hitched rides to the orbiting outpost on Russia's Soyuz spacecraft - at a cost of some US$80 million a seat.
SpaceX's first crew tests on the Dragon capsule will be helmed by shuttle veterans Robert Behnken and Douglas Hurley.
"The 7,000 women and men of SpaceX understand what a sacred honour this was, for us to be part of this program, and for us to fly you", said Gwynne Shotwell, the chief operating officer of SpaceX, at the Friday press conference.
Meanwhile, NASA will announce on August 3 the name of the astronauts assigned to crew the first flight tests and missions for both SpaceX and Boeing. Both Boeing's CST-100 Starliner and SpaceX's Crew Dragon will need to meet stringent safety requirements and prove they are fit for regular flights.
Since the shuttle was retired seven years ago, US astronauts have had to fly on Russian rockets from a remote launch site in Kazakhstan.
NASA has had to partner with Russian Federation to launch astronauts to the International Space Station since the space shuttle program ended. NPR reports that some critics think the SLS is too expensive compared to industry developments like SpaceX's Falcon Heavy.More news: Pakistan Elections 2018: Imran Khan declares victory; promises road for 'Naya Pakistan'
SpaceX will fly an uncrewed test flight in November 2018 and another with astronauts on board in April 2019.
"It's absolutely the opportunity of a lifetime", Mann, a Marine Corps lieutenant who joined NASA in 2013, said during the announcement.
Of the four crews named, two will launch test flight missions and two crews will launch to the International Space Station where they will live and work in space before returning to Earth in the crew vehicles. The crewed flight tests will mostly mirror the uncrewed missions, except a flight commander and pilot will be manning each mission once they are ready for a human crew.
"We congratulate all the astronauts chosen to fly to the space station on commercially developed systems", added Caret, a two-time Wash100 recipient.
The Crew Dragon missions will pave the way for SpaceX's more ambitious projects, like sending the first humans to Mars as early as 2024.
The Government Accountability Office recently issued a warning to NASA that it needs to have a contingency plan in place to ensure continued access to the space station, which costs the USA about $3 billion annually.
Both companies will also conduct abort system test flights to ensure the astronauts can safely escape should their rockets go awry. The cargo missions started in 2012. He was selected as an astronaut in 2000 and piloted space shuttle Endeavour for the STS-126 mission and Discovery on its final flight, STS-133. Once the spacecraft is attached to the space station, it's created to stay there for 210 days.