The Man Who Would Be King is a short story written by Rudyard Kipling that tells the tale of two soldier adventurers, Daniel Dravot and "Peachy" Taliaferro Carnahan, who disguise themselves and set off from 19th century India to become kings of Kafiristan.
Warning: Wikipedia contains spoilers
When they arrive, the natives confuse their Masonic medals for symbols of Alexander the Great and declare the men to be gods. They live the life of gods for a time until they are found out and all ends badly for them.
In the film, the natives decide that Connery's character is a god after he is shot with an arrow in the chest but continues fighting (the arrow strikes a bandolier beneath his clothing and is lodged in it; the character is unaffected). The natives, much later, decide the man is not a god after he is bitten by his bride, who fears marrying a god.
Kipling's original story now appears to be imperialist at least; in Huston's telling, both East and West have their faults and virtues.
The film is the only occasion in which these two giants of modern British cinema have appeared on film together. They both starred in A Bridge Too Far but did not share any scenes together.