The four-time champions dominated possession but struggled to create enough clear-cut chances, as Sweden secured a first appearance at the finals since 2006 courtesy of Jakob Johansson's first-leg strike in Stockholm.
Despite the support of 74,000 fans in a white-hot atmosphere at the San Siro the 2006 World Cup winners could not find a way through.
It is the third time that the Italians will not compete at the World Cup, after not going to the first edition in 1930 and not qualifying for the 1958 finals in Sweden.
It marks the end of an era for iconic goalkeeper Gianluigi Buffon who will not be able to compete in a record sixth World Cup.
At 39, the 175-times capped Buffon had announced that the finals in Russia would be his last as a player for the national side.
"I'm sorry, sorry, sorry," a tearful Buffon told Rai television as he confirmed he was ending his international career.
"I'm not sorry for myself but all of Italian football, because we failed at something which also means something on a social level.
"It's the only regret I have. Not stopping, because time passes and it's normal. I regret just that my final match with the national side coincides with an elimination.
"I leave a squad of talent that will have their say, including (Gianluigi) Donnarumma and (Mattia) Perin. I embrace all those who have supported me."
Without star Zlatan Ibrahimovic, who retired from the national team after Euro 2016, Sweden sealed a return to the world stage after failing to reach the last two editions. The last time the Scandinavians participated was in 2006.
"I'm emotional and very happy," said Sweden coach Janne Andersson. "This match showed our collective strength.
"With Ibrahimovic we played differently. He's retired and he's a great champion. So we adapted and we play in another way now."