The sale price was almost four times the upper pre-sale estimate and it also beat the previous record price for a Churchill painting, which was just under £1.8m.
Tower Of The Koutoubia Mosque was sold at Christie’s in London to an unidentified buyer.
The image of the 12th-century mosque in Marrakech at sunset with the Atlas Mountains in the background was the only painting completed by the wartime prime minister during the 1939-45 conflict.
It was finished after the Casablanca Conference of January 1943, where Churchill and US president Franklin Roosevelt planned the defeat of Nazi Germany.
After the politics and planning, Churchill persuaded Roosevelt to stay an extra day and take the 150-mile drive to Marrakech, telling him he could not travel to North Africa without seeing the sun set on the Atlas Mountains.
The two leaders stayed at a villa on the outskirts of the city and watched the sun go down from its five-storey tower.
According to Nick Orchard, Christie’s head of modern British and Irish art, Roosevelt was mesmerised by the scene.
“It is an incredibly poignant moment,” he told the auctioneer’s inhouse publication.
“Here are two great leaders sharing the briefest respite from the traumas of war.”
After the US delegation departed, Churchill remained for another day and used it to paint the view of the mosque framed by the mountains.
He sent the painting to Roosevelt as a birthday present and a memento of the trip.
Mr Orchard said: “This is Churchill’s diplomacy at its most personal and intense.
“It is not an ordinary gift between leaders – this is soft power and it is what the special relationship is all about.”
The painting was sold after the US president died in 1945 and it had several owners before actress Angelina Jolie and her then partner Brad Pitt bought it in 2011.