The deal for Dias is worth an initial £62m, with a further £3m subject to add-ons, and was confirmed in a statement from Benfica on Sunday night following City's 5-2 defeat at home to Leicester.
In the statement, the Portuguese club said they had agreed a separate fee of 15m euros (£13.6m) to sign Otamendi.
Both deals were subject to personal terms being finalised, the club said, but Sky Sports News understands that Dias has completed his medical in Portugal and has agreed personal terms.
City boss Pep Guardiola has been seeking a right-sided centre-back since Vincent Kompany left last year.
Dias has impressed during three seasons at Benfica and was in Portugal's 2018 World Cup squad.
The 23-year-old scored and captained the side in Benfica's 2-0 win over Moreinense on Saturday, after which Dias was pictured hugging Benfica's sporting director Rui Costa.
Speaking after the game, Benfica manager Jorge Jesus said: "I'm pretty sure it was his (Rúben Dias's) last game, but sometimes everything changes at the last second in football. I don't think that's going to happen, though.
"He's a player we're sorry to see go, he came through the academy, is our captain and plays for the national team. I also take some of the blame for him leaving today.
"This is also to do with getting knocked out of the Champions League and there are things that need to be balanced (financially) at management level. He has a high market value and is certainly already a fantastic player who will continue to improve."
Napoli defender Kalidou Koulibaly had been City's top target but his valuation has remained out of reach so far, while Sevilla's Jules Kounde also emerged as one of their preferred options.
City have denied placing a £78m bid for Atletico Madrid centre-back Jose Gimenez, after the La Liga club's president claimed he had rejected an offer for the central defender.
Analysis: Dias a natural leader
Portuguese journalist Valter Marques told Sky Sports:
"Ruben has grown up with Benfica - and everybody has known for a long time he was going to develop into an amazing player.
"He is very strong aerially and an aggressive defender, without getting on the wrong side of the referee's whistle.
"Dias' style will fit Manchester City well in that he enjoys being the starting point in creating attacks, and even at 23 he is already a great example of a leader at the back - unless he's celebrating a goal, you won't often see him smiling."
'Pep's defenders aren't good enough'
Speaking after City's 5-2 defeat to Leicester, Sky Sports' Gary Neville said:
"They were so good in the opening 25 minutes but as soon as Leicester broke on them a couple of times, you felt that, psychologically, it just damaged them.
"Some of the wounds from last season are reappearing. The bugs that cost them the title. Certainly, you can get at this Manchester City back four a lot quicker that you could previously. They don't seem to react in transition higher up as they did."
On the three penalties: "Three different players making the same basic error. Rashness. Naivety. Whatever you want to call it, it is there in that backline. Pep Guardiola is looking to see if he can defend his players but I am not sure he can.
"His defenders aren't good enough, whichever way you want to look at it. He is a great coach, one of the greatest coaches of all time. But one-on-one, once his defenders get in those positions, they are really poor. It is almost like in their mind they cannot get their head around the fact that someone has got goal-side of them."
'Dias brings the Kompany replacement search to an end'
Analysis from Sky Sports News reporter Ben Ransom...
Ruben Dias is about to join Manchester City in a £64.3m move from Benfica, which will finally bring to an end the search for a central defender to replace Vincent Kompany.
The player has already completed his medical in Portugal and personal terms have been agreed after the clubs settled on a fee.
City have looked high and low to try to find someone with the right profile to fill the void left by their long-serving captain - and in Dias they believe they have ticked all the boxes in terms of age, profile and quality.
It's no surprise to learn that City started looking at Dias as far back as 2018, the beginning of Kompany's final injury-hit season at the Etihad where he was restricted to just 13 Premier League starts.
Dias has grown in stature at Benfica during three successful seasons, captaining the side at just 23-years-old, and he was also part of the Portugal squad at the 2018 World Cup.
City believe that they're getting extremely good value for money in this deal, paying £62m up front with the rest in add-ons, for a player that had an £80m release clause after signing a new contract at Benfica last summer.
It's also significantly lower than the £70m they were quoted for Napoli's Kalidou Koulibaly, especially when you consider the £13.6m City are getting from Nicolas Otamendi moving in the opposite direction.
City were also priced out of a move for Jose Gimenez, and despite never making an offer, they were not willing to enter into negotiations once Atletico set a valuation of more than £80m.
Sevilla's Jules Kounde was another serious option this summer, but it's felt that he would have been more of a risk given the fact he's less established than Ruben Dias at just 21 years of age.
Man City will confirm the signing of Ruben Dias as soon as Nicolas Otamendi's move to Benfica is finalised, with both deals planned to be announced at the same time.
Summer transfer window - key dates and times
The summer transfer window closes at 11pm on Monday October 5 with a feast of activity lined up on Transfer Deadline Day on Sky Sports News and across our Sky Sports platforms.
A domestic-only window for deals between the Premier League and EFL then runs from October 5 and closes on Friday October 16 at 5pm.
Source: Sky Sports