Five-time German champions VfB Stuttgart were relegated and Union Berlin promoted to the Bundesliga top flight for the first time after a goalless draw in the second leg of the relegation and promotion play-off on Monday.
Union benefited from the away goals rule after drawing 2-2 in the first leg in Stuttgart on Thursday.
Fans flooded the pitch at the Alte Foersterei stadium in Berlin after the final whistle and flares and fireworks were set off in scenes which could lead to sanctions.
A tearful Union Berlin president Dirk Zingler said: “I have been at the club for 40 years and have waited so long for this day.”
Union become the 56th side and the fifth club from the former East German Oberliga to play in the Bundesliga, the first since Energie Cottbus were relegated in 2009.
Their promotion comes after avoiding bankruptcy in 2004 while it is a third relegation for Stuttgart after 1975 and 2016.
Stuttgart were Bundesliga champions in 1984, 1992 and 2007 with two further titles in the early 1950s before the Bundesliga was formed.
Union join Cologne and Paderborn as the promoted sides while Stuttgart are relegated alongside Hanover and Nuremberg.
Stuttgart had the better of the play in the first half but could not break down a Union side who also had chances when Suleiman Abdullahi twice hit the post within three minutes.
Stuttgart did have the ball in the net early on when Dennis Aogo curled in a free-kick, but after a video review the goal was ruled out because Nicolas Gonzalez in an offside position was blocking keeper Rafal Gikiewicz’s view.
Central defender Ozan Kabak had an early chance blocked by the keeper, and both he and Holger Badstuber played on with their heads bandaged after a clash of heads in the 20th minute.
Steven Zuber had a shot parried away for a corner by Gikiewicz before the teams went goalless into half-time.
Union had to wait until the 64th minute for their first real chance when Abdullahi rifled a shot against the post, and then saw an effort, after he had slipped under a challenge, trickle past keeper Ron-Robert Zieler but come back off the post.
Stuttgart failed to create much after the break but upped the pressure in the closing stages and Benjamin Pavard had a shot parried away for a corner, but the Union defence held out to trigger scenes of joy at the final whistle.
Stuttgart sports director Thomas Hitzlsperger told Eurosport: “This is brutally disappointing. So much has gone wrong this season. We have had three coaches, and in the end it was not enough.”
Caretaker coach Nico Willig will now make way for Tim Walter from July 1, whose immediate task will now be to get back Stuttgart back into the top flight.