Everton and Barcelona have reached an agreement over a transfer fee for Colombian defender Mina and Gomes is also being sent to Goodison Park, but on loan.
In March, having endured consistent criticism for failing to live up to his Valencia form, the 25-year-old described his Barca spell as "a kind of hell", admitting he had struggled with depression.
The defender will leave Camp Nou despite only joining in January, but the Catalan side have included a buy-back option in the deal.
A summer that started with the intention of balancing the books ended with a flourish as Farhad Moshiri, Everton's major shareholder, sanctioned a deal for Mina, which took the club's spending to about... "That is important for me and the club". The France global, who spent last season on loan at Stoke City, had also been linked with Old Trafford but was in line to become Everton's fourth recruit of the day after paperwork was submitted moments before the 5pm deadline. Muhamed Besic was lined up for a £6m return to Middlesbrough only for the deal to collapse late on while Everton rejected several loan offers for Yannick Bolasie, who they want to sell on a permanent basis.
Gomes added: "I'm delighted to sign for this fantastic club - it's a good day for me".
However, Manchester United were put off by the excessive demands made by the player's agents, which ultimately resulted in them pulling the plug on the move. "Everybody in Portugal knows how Marco Silva works and his abilities as a coach".