The transfer will be worth £34million, which includes £5m in add-ons, as well as agreeing a five-year deal at the club.
The player travelled to London for a medical on Friday with a view to completing a permanent deal.
"Deal complete for the amount of €40m, and of these, €5m are dependent on the achievement of sports objectives", a statement from the Portuguese club said.
An attacking midfielder by trade, he enjoyed an excellent campaign for Porto, scoring six goals and providing 14 assists.
At 22 years of age, it's thought that Vieira is ready to take that next step in his career by moving to one of Europe's biggest sides.
Vieira's form had alerted the likes of Manchester United, Liverpool and Tottenham to his services, however it now seems that a move to Arsenal is the most likely outcome.
A Portugal Under-21 international, he is the Gunners' second signing of the summer after they completed a deal for Marquinhos.
Arteta will have some serious work to do if he's to secure a top four finish for Arsenal this summer.
If they are to close the gap on the likes of Tottenham and Chelsea, the Gunners will need to make some significant improvements to their squad, with former Premier League striker Darren Bent recommending two attacking additions in particular.
Asked who he'd like Arsenal to sign, Bent told talkSPORT: "Gabriel Jesus.
"I'd like to see him go to Arsenal. I think he'd be brilliant.
"He's not necessarily got a point to prove, but I think he needs regular football now and I think he's more than good enough to score the goals to help Arsenal to get back to where they'd like to get to.
"So, I think that would be a really good addition to the squad.
"And Christopher Nkunku from Leipzig. He'd cost a lot.
"I think there's talk about him going back to Paris Saint-Germain, but I love him.
"I think he fits the bill. He can play as a centre-forward, he can play off the left, and he can play off the right.
"I know two out of those three are attack-minded, so maybe we should be concentrating on another pair of full-backs."
But Jesus won't be cheap either. The Man City striker has been linked with plenty of clubs this summer, including Spurs, Chelsea and Real Madrid, but The Times suggests Arsenal may meet Man City's £50m valuation.