The C-17 Globemaster III from RAF Brize Norton in Oxfordshire was flying north west at around 24,000ft near Shrewsbury when it raised the alarm.
The giant plane turned round and reportedly dumped fuel as it made for Birmingham airport 50 miles away where it landed safely just before noon.
One Shropshire Star reader who monitored the flight on the Flightradar24 flight tracker website said: "It reported 'Emergency overhead, RRR818, smoke in cockpit, squawk 7700'.
"Apparently there were smoke and flames in the cockpit, but he got down safely."
The Flightradar24 data shows that the plane flew over the Ironbridge Gorge and west Telford before starting a wide left hand turn near Shawbury, taking it west of Shrewsbury and over Bayston Hill before flying directly to Birmingham Airport where emergency services stood by as it came in.
RRR818 is believed to have been a flight code, and squawk 7700 is a transponder code signalling a general emergency.
The aircraft is thought to have been heading for Prestwick Airport in Scotland before getting into trouble about 20 minutes into the flight. Total flight time was 34 minutes.
Craig Lloyd, who works at Resorts World near Birmingham Airport, was taking a coffee break when he spotted the plane.
He said: "I was sitting in my car when I saw the plane coming in to land and I thought 'Wow, that's a big plane!'.
"It stopped on the runway, then suddenly there were five or six fire engines heading towards it."
An RAF spokesman said: "A RAF C-17 Globemaster from RAF Brize Norton on a routine training mission suffered a technical issue requiring it to land as soon as practicable.
"The aircraft completed an uneventful precautionary recovery to Birmingham Airport where the aircraft landed safely."
On social media one user tweeted: "Pleased that the crew is OK and the aircraft landed safely, after rapidly dumping fuel and a rapid descent into Birmingham Airport after squawking 7700 over Shrewsbury."