Koeman, 57, leaves his role as Netherlands boss to take over at Camp Nou. His contract includes a break clause at the end of the first year in the event that the new Barca president -- elections will be held next March -- wants to bring in their own coach.
Koeman said: "It was an honour to be the national coach of Netherlands. For the past two-and-a half-years I have done everything I can to achieve successes with 'Oranje'. I look back with pride on what we have achieved together in that period. The Dutch national team has a bright future, I am convinced of that. Everyone knows that Barcelona is my dream club. It feels very special to me to be able to become a coach there."
ESPN reported on Friday, ahead of Barca's 8-2 defeat to Bayern Munich in the Champions League, that Koeman had been sounded out as a possible replacement for Setien, who only took charge in January. Talks accelerated over the weekend following the club's record European loss.
Koeman returned to Barca as assistant coach to Louis van Gaal between 1998 and 2000 and has been linked with the top job at the club on various occasions since.
Along with Xavi Hernandez, he was one of the candidates considered in January when Ernesto Valverde was fired. Barca eventually appointed Setien after Xavi turned them down, with Koeman, at the time, focused on leading Netherlands at the European Championship.
However, a number of circumstances have changed since then, with the coronavirus pandemic forcing the postponement of Euro 2020 until 2021.
Koeman, meanwhile, underwent a heart procedure in Amsterdam in May after experiencing chest pain. Sources close to the coach said he is in "perfect health" as he prepares to get to work at Barca.
The Dutchman has never hidden his desire to coach Barca and has maintained a close relationship with the city throughout his professional career. He recently brought a house in Vallvidrera, on the outskirts of Barcelona.
Sources at the Catalan club say they have turned to Koeman as they believe he will garner immediate respect among the players. The relationship between the squad and Setien was at breaking point by the time they were hammered by Bayern. The overriding feeling at Barca was that he failed to win the dressing room from Day 1 because of his relatively limited achievements as both a player and a coach.
Another source at Barca pointed to how Koeman cleared out an ageing squad at Valencia in 2007, and he will have to do a similar job in Catalonia -- the average age of the starting lineup against Bayern was nearly 30.
ESPN reported earlier this year that only three players have a secure future in Barcelona -- Marc-Andre ter Stegen, Frenkie de Jong and Lionel Messi -- and that stance has been strengthened following a first trophyless season since 2007-08.
Barca announced the departure of technical secretary Eric Abidal hours before confirming Koeman as coach. Koeman, in collaboration with Ramon Planes, will now be tasked with a major overhaul of the playing staff ahead of the start of the new campaign in September. Planes will be making a step up after previously serving as Abidal's No. 2.
Koeman's first job in management was with Vitesse in 2000. He later spent four years as the Ajax coach before spells with Benfica, PSV, Valencia, Az Alkmaar and Feyenoord. He spent three years in England, first with Southampton and later with Everton, and has been in charge of the Netherlands since 2018, helping them qualify for their first major tournament since 2014.
Koeman's assistant with Netherlands, Dwight Lodeweges, will take charge of the team while the Dutch FA decide on a successor.
Director of football Eric Gudde said: "We regret Ronald's decision, but respect his choice. In the period that Ronald has been national coach, he has achieved very good results with the Dutch national team. He has given the team colour to the cheeks again, after a number of difficult years. And we are very grateful to him for that. The players group has developed tremendously in the meantime, in that respect we can continue on the same path."