Erik Selvig is a character portrayed by Stellan Skarsgård in the films of the Marvel Cinematic Universe (MCU). An astrophysicist who becomes involved with the alien Thor and the government organization S.H.I.E.L.D., he first appeared in the 2011 film Thor. Skarsgård went on to reprise the role in The Avengers (2012), Thor: The Dark World (2013), and Avengers: Age of Ultron (2015). To tie into these appearances, the character is seen in several MCU tie-in comics. The character also appears in other media, including non-MCU comics published by Marvel Comics.
In Thor, astrophysicist Erik Selvig works with Jane Foster, the daughter of a former colleague of his, on her wormhole research. They become involved in an encounter between Thor and S.H.I.E.L.D., leading to his employment by the latter to study the Tesseract—he accepts the job due to influence by Loki. In The Avengers, Loki uses the Tesseract to travel to Earth, and places Selvig under the control of the Mind Stone. Selvig is eventually freed of this control and able to help stop Loki's invasion of Earth, but is left near insane by his experience. Selvig is able to help Thor again in Thor: The Dark World, and by Avengers: Age of Ultron appears to have regained his sanity. After the defeat of Ultron, Selvig begins working for the Avengers.
Selvig appears in the MCU tie-in comics The Avengers Prelude: Fury's Big Week and Thor: The Dark World Prelude in the same capacity as he does in the films.
In October 2009, Stellan Skarsgård joined the cast of Thor, which was written by Ashley Edward Miller, Zack Stentz, and Don Payne; Skarsgård signed a five-film deal with Marvel. His character Erik Selvig appears in the post-credits scene at the end of Thor, which was directed by The Avengers director Joss Whedon. This set up Selvig's role in that film. After also appearing in Thor: The Dark World and Avengers: Age of Ultron, Skarsgård noted in February 2015 that he had one more Marvel film in his deal, that he would not be appearing in Thor: Ragnarok, and that he possibly could appear in another Avengers film.