Once The Avengers bring back the Sceptre from Strucker's facility, **Tony** (and **JARVIS**) start running some diagnostics on it. Eventually, they find some kind of AI (_Artificial Intelligence_) residing within the gem. This AI turns out to be **Ultron** which suppresses **JARVIS** and starts uploading it's consciousness into the *Iron Legion* drones.

But, how does Ultron (_or his consciousness_) end up in **Loki's** Sceptre at the first place? 

Has the existence of **Ultron** residing inside the Sceptre ever been touched upon in the *Marvel Cinematic Universe*?

**Update:** *Based on the first answer here I would like to further clarify the scope of this question.* 

Is Ultron a godlike being (_as portrayed in the Comics_) residing within the Sceptre? If yes, how did he end up there? Or is it a tech created by Tony Stark and powered by the Mind Stone?