Perhaps because of the secrecy around the X-37B, the Air Force made its announcement just months ahead of the launch. It was thought that the private space company's first Air Force mission would be lofting a GPS satellite into orbit 2018, since it was awarded a contract for that last year. It's been speculated that the unmanned spaceplane, which lands back on Earth like the space shuttle, is used for top-secret reconnaissance or even anti-satellite purposes. (The Air Force didn't specify why it chose SpaceX for the launch.)
United Launch Alliance, a partnership between Boeing and Lockheed Martin, launched the last four X-37B missions with the Atlas V rocket. The Air Force's decision to use SpaceX is unusual, since not only does the Atlas V have a perfect record since 2002, Boeing is the prime contractor on the X-37B itself. The Air Force has two X-37Bs, one of which spent over a year in orbit, finally coming down in 2012.
Back in 2014, SpaceX's Elon Musk essentially accused ULA of bribing the Air Force to get an exclusive deal to launch 36 missions. Soon after, the Air Force approved SpaceX as a launch contractor, and reauthorized it again after a SpaceX rocket exploded on the launchpad during refueling in September, 2016.
The mission will be SpaceX's third for the Air Force. The other two missions for GPS satellites, valued at $83 million and $96 million, will launch in 2018 and beyond. While the X-39B contract is a coup for SpaceX, it's reportedly not a difficult launch. The low Earth orbit-bound spaceplane weighs just 5 tons, and the Falcon 9 has five times that capacity -- so expect to see a recovery of the first stage.