Trotz was the Predators' coach for 15 seasons before being dropped from the job in April. In Washington, he takes over for Adam Oates, who was fired last month with a season left on his three-year deal.
MacLellan replaces George McPhee, whose contract was not renewed after 17 seasons as the Capitals' GM.
In the team's news release announcing Monday's moves, owner Ted Leonsis said Trotz was "the only coach we coveted" and called him "an ideal fit to help lead our club."
It's a change in philosophy for the Capitals in terms of picking a coach: Each of McPhee's choices for the job had never previously been a head coach in the NHL.
Capitals captain Alex Ovechkin has won three league MVP awards and again led the NHL in scoring this season with 51 goals. But the Capitals haven't made it past the second round of the playoffs during the Russian wing's career.
"Barry's teams have always played with structure, discipline and intensity, and I look forward to him leading us to success for many years to come," said MacLellan, who also gets the title of senior vice president.
MacLellan has been with Washington for 13 seasons, seven as assistant GM. He was with five clubs during a 10-year NHL playing career.
"After conducting an extensive search for a general manager, we determined that Brian was the best candidate to help us reach our ultimate goal, winning the Stanley Cup," Leonsis said. "We have witnessed his abilities firsthand, and we have tremendous respect for how he manages people and situations."
Trotz and MacLellan will be introduced at a news conference Tuesday.
When Leonsis held a news conference in late April to discuss the dismissals of McPhee and Oates, the owner said: "I just felt that new leadership at this time was needed, and let's start it with a clean slate."
From 1992-97, Trotz coached the Capitals' top minor league affiliate in the American Hockey League. He was hired by the Predators in August 1997, when the club was preparing for its expansion season of 1998-99.
Before leaving Nashville, Trotz had been the league's longest-tenured coach with one team.
"We are getting an experienced and well-respected coach whose presence and tutelage will benefit our players," Capitals president Dick Patrick said.
His Predators contract was set to expire at the end of June, and that club offered him a job in their hockey operations department. But Trotz -- a finalist for the Jack Adams award as the top coach in the NHL twice in the past five seasons -- made clear at the time that he wanted to keep coaching.
The Predators failed to make the playoffs each of the past two seasons.
Capitals Tap Barry Trotz As Coach
Pierre LeBrun breaks down why the Washington Capitals decided to hire former Nashville Predators coach Barry Trotz to the same position. LeBrun also breaks down Washington's decision to promote Brian MacLellan to the position of general manager.