Interim United boss Ole Gunnar Solskjaer has got off to a flying start at Old Trafford, winning his first five games in charge, but will face one of his sternest tests yet against Unai Emery's side.
The game will be one of only three guaranteed all-Premier League ties, with Crystal Palace taking on Tottenham and Manchester City facing Burnley, although Newcastle could also come up against Watford if the Magpies get through a replay against Blackburn.
Elsewhere in the top flight, Everton will travel to Millwall, Chelsea face either Sheffield Wednesday or Luton at Stamford Bridge and Brighton play West Brom at the Amex and Southampton will play Accrington Stanley if they get past Derby County.
The only non-league side left in the competition, Barnet, were given a home draw against fellow London side Brentford.
Oldham's reward is a trip to Doncaster Rovers, while Tony Pulis' Middlesbrough will entertain Newport County.
Fourth-round ties will be played from January 25 to 28.
Draw in full:
Swansea City v Gillingham
AFC Wimbledon v West Ham
Shrewsbury Town/Stoke City v Wolves
Millwall v Everton
Brighton and Hove Albion v West Brom
Bristol City v Bolton Wanderers
Accrington Stanley v Derby County/Southampton
Doncaster Rovers v Oldham Athletic
Chelsea v Sheffield Wednesday/Luton Town
Newcastle United/Blackburn Rovers v Watford
Middlesbrough v Newport County
Manchester City v Burnley
Barnet v Brentford
Portsmouth v QPR
Arsenal v Manchester United
Crystal Palace v Tottenham