Keir was born Andrew Buggy in Shotts, Lanarkshire, Scotland. He was the son of a coal miner, and had five brothers and one sister. At 14, he left school to work down the coal mine alongside his father. He started acting by chance, when he went to meet a friend at the Miners' Welfare Hall, and one member of the cast of an amateur dramatics production being performed at the Hall had failed to turn up. Keir was persuaded to take the minor role of a farmer in the play, and enjoyed the experience so much that he later became a regular in the group's performances.
The group entered a competition in Inverness, where Keir's talent was spotted and he was offered the chance to become a professional actor at the Unity Theatre in Glasgow. Since this was after the start of the Second World War, he could not easily leave his occupation as a miner; he was only able to accept the offer after he obtained a medical diagnosis of pneumoconiosis, which freed him from his work in the mine.
After a few months at the Unity Theatre, he was offered a place at Glasgow's Citizens' Theatre by director Tyrone Guthrie. He accepted, and remained with the Citizens Theatre company for nine years. At the Citizens', he was a contemporary of Phyllida Law and Fulton Mackay; Keir and Mackay used to escort Law from the theatre to the local tram stop so that she would not be accosted by local gangs because of the English accent that she had developed at drama school.
Keir made his film debut in 1950 in The Lady Craved Excitement, and performed in his first major screen role in The Brave Don't Cry (1952). The film concerned the rescue of a group of miners trapped underground after an accident in the pit, with Keir playing a miner who places a bet on a horse race via the mine's telephone system while trapped; he was given the final line of dialogue, as he emerges from the pit following his rescue and asks who won the race.
He began to win increasingly prominent film roles throughout the course of the 1950s, appearing in the Ealing comedy The Maggie (1954) and the Titanic film A Night to Remember (1958), in which he portrayed 2nd Engineer John Henry Hesketh He played Marcus Vipsanius Agrippa in the 1963 Richard Burton and Elizabeth Taylor vehicle Cleopatra.
Keir also continued to act on the stage. He played Robert Burns in the pageant I, Robert Burns in 1959, celebrating the 200th anniversary of the birth of the poet. In 1960 Keir initiated the role of Thomas Cromwell in the original theatrical production of Robert Bolt's play A Man for All Seasons. Keir's performance in this part was praised by The Times as being "an arresting figure". In 1964, he was a member of the original West End cast of Lionel Bart's musical Maggie May, playing the trade union leader.
He had first appeared on television on the BBC in the early 1950s, and through that decade and into the 1960s continued to make guest appearances in a range of programmes, including Danger Man, Dr Finlay's Casebook, The Avengers and Z Cars. However, it was in films where he became most prominent during the 1960s and early 1970s, particularly in Hammer's famous range of "Hammer Horror" productions. He appeared in Pirates of Blood River (1962), Dracula: Prince of Darkness (1966), The Viking Queen (1967) and Blood from the Mummy's Tomb (1971). By far his most prominent role for Hammer came in 1967's Quatermass and the Pit; this remained one of Keir's personal favourite roles of his career, and his obituary in The Independent claimed that "Keir's mixture of gruff determination, intelligence and quirkiness made him the definitive professor."
In 1966, Keir joined the cast list of the second Doctor Who big screen adventure, Daleks – Invasion Earth: 2150 A.D., alongside Peter Cushing.
Keir continued to appear on screen throughout the 1970s and 80s, in films such as Zeppelin (1971) and The Thirty Nine Steps (1978). He also continued to have success with television roles; the Australian series The Outsiders demonstrated again the wide range of types that he could convincingly play, but brought him less praise than the BBC series Workhorses, for which he was nominated for BAFTA Scotland's Best Actor award. He continued appearing in TV series well into the 1990s, guest starring in an episode of Hamish Macbeth in a part that was written especially for him; the series was produced by his daughter, Deidre.
His final major acting role was as John Campbell, 2nd Duke of Argyll (1678–1743) in the film Rob Roy (1995), although he also played a prominent role as Fergus in The Princess Stallion in 1997, the year of his death. Argyll was another role that became one of his favourites. His final professional engagement was resuming the role of Quatermass for the 1996 BBC radio serial The Quatermass Memoirs. This final performance was praised by The Independent: "This series has so far been hugely enjoyable - thanks in large part to Andrew Keir, who recreates the role of Quatermass in dramatic interludes; lesser actors would treat Kneale's downbeat script with a certain detachment, but Keir is prepared to charge even the most banal lines with a terror that's both a treat and a lesson."
Keir died in hospital in London, aged 71, on 5 October 1997. From 1948 until 1977, he was married to Julia Wallace, with whom he had two sons and three daughters. In 1977, he married Joyce Parker Scott, who survived him, along with his five children from his previous marriage. One of his daughters is the actress Julie T. Wallace.