(CNN) Anis Amri, the Tunisian suspect identified in this week's deadly attack on a Berlin Christmas market, died Friday in a shootout in Milan, according to Italian police.
The suspect was killed just after 3 a.m. local time, the Italian state police said on its Twitter feed.
When the man was asked for his papers by police, he pulled a .22-caliber gun out of his backpack and fired, according to the tweet. The driver of the police car returned fire, killing the suspect. A police officer was injured in the shootout, according to Italian police.
Amri, 24, had become a wanted man after Monday's attack in Berlin that killed 12 people and injured 48. Though others could have been involved, Amri was the only suspect who had been publicly identified.
He had been considered violent and believed to be armed.
And according to German investigative files that CNN saw Thursday, Amri had previously discussed launching an attack in Germany.
Here's what we know about him.
Amri was one of four children, according to a man who claimed to be his father.
The man said in an interview on Tunisian radio that Amri left for Italy about seven years ago after dropping out of school.
While in Italy, he served four years in prison after he was involved in an arson attack on a school, his father said. Amri left for Germany more than a year ago, he added.
The elder Amri said he had not been in touch with his son, though the younger Amri maintained sporadic contact with his siblings.
A spokesman for the Italian state police, Mario Viola, told CNN that Amri's jail term for damaging state property, assault and arson at the Lampedusa refugee center began in late 2011. He was released in May 2015.
Amri entered Italy in February 2011 without any ID and claimed to be a 17-year-old minor, according to the spokesman. Italian authorities ordered his deportation, but Tunisian authorities wouldn't accept the request on the grounds of a lack of proper documentation, Viola said.
At that point, Italian authorities told Amri to leave the country, and officials lost track of him, according to Viola. Amri was "not suspected" of terrorism at the time and was considered a "petty criminal," Viola said. The Tunisian came to Italy at the same time as thousands of others amid the turmoil of the Arab Spring, he said.
Amri was believed to have gone to Germany in July 2015 and had traveled between Berlin and other cities -- but was mostly in Berlin since February, said Ralf Jaeger, interior minister of the German state of North Rhine-Westphalia.
Amri requested asylum in Germany but was denied, according to Jaeger.
Deportation proceedings were started but were not completed because Amri's identity could not be definitively established, according Stephan Mayer, a spokesman for the Christian Democratic Union/Christian Social Union parliamentary group.
While in Germany, authorities had their eye on Amri -- he was believed to be in touch with radical Islamists, including a recruitment network for ISIS operating in Germany, German security officials told CNN.
When ISIS lives next door: Tunisia's desperate fight against extremism
The main figure in the network, Ahmad Abdulaziz Abdullah -- a 32-year-old Iraqi national also known as Abu Walaa -- and four others were arrested and charged with terrorism offenses in November.
Jaeger said he could not confirm a link to Abu Walaa.
But according to the investigative files that CNN saw, German authorities were aware that Amri had close ties to the Abu Walaa network.
Amri was particularly close to one of those charged in November, Boban Simeonovic, a German intelligence official told CNN.
Amri was mentioned several times by name in the 345-page investigative file, which underpinned the case built by prosecutors.
"Anis spoke several times about committing attacks," a police informant told German investigators, according to the files. The informant said Simeonovic and another member of the network "were in favor of that and gave him a place to hide."
Members of the Abu Walaa network also discussed driving a truck full of gasoline with a bomb into a crowd, the police informant told investigators, according to the documents.
In late 2015 and early 2016, Simeonovic tried through his contacts at a mosque in the northern German town of Hildesheim to arrange logistics for Amri to leave the country, according to the files.
According to the police informant, Simeonovic repeatedly stressed to followers in Germany that there was a "state of war" in the country. Simeonovic and Abu Walaa "deem attacks justified, desire attacks, and support attackers," the informant stated.
"The only topic when I moved in these circles ... was how to join the armed jihad or how to get it to Germany ... by which I mean armed jihad for the Islamic State," the police informant said.
Amri -- who was thought to have used six aliases, according to authorities -- also showed up on the radar of German police because he was looking for a gun, one German security official said.
In August, he was arrested with forged documents in the southern German town of Friedrichshafen en route to Italy, the security official said.
But a judge later ordered his release.
Inside the truck that plowed through the Christmas market, authorities found a Polish man shot dead and a set of identity papers belonging to Amri.
The slain driver may have been involved in a struggle with the suspect inside the truck's cabin before being shot, CNN terrorism analyst Paul Cruickshank said. The papers could have been dropped during some sort of altercation.
Authorities publicly identified Amri on Wednesday, released pictures of him and offered a reward of up to 100,000 euros (about $104,000) for information on his whereabouts.
Germany's federal prosecutor said raids had taken place Thursday in cities across Germany. One was in Emmerich, in North Rhine-Westphalia, at a refugee shelter where Amri reportedly stayed before moving to Berlin.
Police also carried out a number of raids in the region on Wednesday, a German security official told CNN.
ISIS claimed it inspired the attack. The terror group's affiliated Amaq News Agency described the perpetrator as a "soldier of the Islamic State" who had acted in response to calls for attacks in the West.