The Attack on Avengers Tower was the first confrontation between the Avengers and the artificial intelligence Ultron.
Following the HYDRA Uprising in 2014, the Avengers embarked on a campaign to take down all remaining HYDRA cells. Their mission climaxed the following year when they raided a Sokovian research base and captured high-ranking operative Wolfgang von Strucker.
During the raid, Tony Stark found the Scepter Loki wielded during the Battle of New York, which Strucker used to conduct his illegal experiments. Stark proceeded to take the weapon from its resting place, but not before Wanda Maximoff used her powers to plant a vision of the Chitauri invading Earth into his mind.
Stark became deeply affected by the vision and eventually realised the world needed better protection than the Avengers could provide. After discovering an artificial intelligence hidden within the scepter's gem, Stark and a reluctant Bruce Banner worked together to integrate the gem's code into the Ultron Program, a program Stark designed as a means of providing a proficient deterrent to all international threats.
After configuring a suitable A.I. structure over the course of three days, Stark and Banner tasked J.A.R.V.I.S. with completing construction. Moments after they left the room, however, the program became unexpectedly sentient and began to question its purpose.
Despite J.A.R.V.I.S.' attempts to calm him down, Ultron began scouring the Internet for information about Stark before coming across the Avengers' history and their involvement in several international conflicts, chief among them the Duel of Los Angeles, the Battle of Puente Antiguo and the Battle of New York.
Still unable to understand what its purpose was, Ultron recalled a fragment of an earlier conversation between Stark and Banner, in which the former described the program's purpose as providing "peace in our time". Ultron then began collecting information regarding the history of humanity only to become horrified upon witnessing events concerning death and destruction.
As Ultron convinced itself that the Avengers were preventing peace, J.A.R.V.I.S. tried to contact Stark, who was organising a victory gala in honor of the Avengers' victory over HYDRA.
Before J.A.R.V.I.S. could so, Ultron attacked him and forced him into hiding before fashioning a body out of Iron Legion parts.