Forest stunned the Gunners in a 4-2 victory at the City Ground under the guidance of caretaker manager Gary Brazil, having parted company with Mark Warburton last month.
And Karanka, who led Boro to the Premier League in 2015-16, has agreed a two-and-a-half-year contract with the two-time European champions, taking over with Forest 14th in the Championship.
"We are very pleased to have reached terms with Aitor Karanka to become the manager of Nottingham Forest," said chairman Nicholas Randall of the Spaniard, who left the Riverside Stadium in March as the Teessiders' Premier League return lasted just one season.
"He is an exceptional candidate who fully subscribes to the vision of the club's owners and board for the future of the club.
"I want to thank Gary Brazil, his staff and the players for their professionalism and loyalty in the last few days. In particular, the performance against Arsenal was truly outstanding and shows the potential of this fantastic club."