Bournemouth also needed penalties to get past League Two side Forest Green after a 0-0 draw. Goalkeeper Mark Travers saved all three spot kicks by the visitors as Eddie Howe's team won the shootout 3-0.
Everton needed two late goals to get past League One team Lincoln 4-2. Lincoln had taken the lead after just 21 seconds through Harry Anderson and then made it 2-2 in the 70th with a volley from Bruno Andrade.
But summer signing Alex Iwobi scored his first goal for Everton to restore the lead for good in the 81st and Richarlison added a late goal for the visitors.
The Premier League teams playing in Europe will enter the competition in the third round, with defending champion Manchester City visiting Preston. League Two side Colchester, which beat Crystal Palace on penalties on Tuesday, was rewarded with a home game against Tottenham.