8 May 2017 Last updated at 17:19 BST
The reusable, unmanned X-37B craft landed at Nasa's Kennedy Space Center in Florida, USA, on Sunday.
But what has it been doing in that time? And what was it sent to find out?
Ricky's been looking into the mysterious aircraft and its mission.
A US military plane has returned to Earth after being on a secret mission in space for the last two years.