Manchester United will play Rayo Vallecano at Old Trafford on July 31 to wrap off their preparations for the 2022-23 season.
The match will be the first home game for new head coach Erik ten Hag, and it will take place one week before the start of the new Premier League season.
Man United will begin their pre-season with a friendly against Liverpool in Bangkok on July 12 before heading to Australia on July 15 to face A-League club Melbourne Victory, followed by a match against fellow Premier League side Crystal Palace on July 19, all of which will be held in Melbourne.
The 20-time English winners will next travel to Perth on July 23 to face Aston Villa at the Optus Stadium, followed by a match against Spanish heavyweights Atletico Madrid on July 30, one day before the encounter against Rayo.
As a result, Ten Hag will aggressively rotate his team for the matches on Saturday and Sunday in order to get his players ready for the upcoming season.
"Pre-season is all about preparation and this is a great opportunity for those squad members who may not have featured in some of our earlier Tour and pre-season matches to get valuable minutes on the pitch – and where better to do this than Old Trafford?" Man United football director John Murtough told the club's official website.
"This will be the new manager's first match at Old Trafford, and I am sure the fans will provide him with a warm welcome."
Man United will formally begin pre-season training on June 27, according to Ten Hag, albeit players who are representing their nations this month will not join the club until later.
The Red Devils finished sixth in the Premier League last season, reaching the fourth round of the FA Cup, the third round of the EFL Cup, and the Champions League last-16 stage.
Former Red Devils Bebe and Radamel Falcao are part of Rayo's first-team group, which finished 12th in La Liga last season.
Man United will not be in the Champions League next season, but despite a dismal finale to the 2021-22 season, they have qualified for the Europa League group stage.
Ten Hag is hoping to add some fresh faces to his roster for the team's pre-season start next month, with Barcelona's Frenkie de Jong, Ajax's Jurrien Timber, and Antony, and Villarreal's Pau Torres all connected with moves to Old Trafford.