Flight SAS31B, which set off from Stockholm around 9.30am this morning, made an abrupt turn towards Edinburgh while flying over Fife.
The aircraft sent out a Squawk 7700 code, which indicates that an emergency situation has taken place on board.
A spokesperson for Scandinavian Airlines said the diversion was made after a passenger fell ill.
The flight was originally due to land in Dublin at 11:10am.
Edinburgh Airport also confirmed the diversion.