La Liga strugglers Almeria's season has gone from bad to worse with a 1-0 Copa del Rey defeat at the hands of fourth-tier Barbastro.
Franc Carbonell scored in the 28th minute to put the club from northeastern Spain into the third round.
The result added to Almeria's woes this season, with the Saudi-owned club having recorded only one victory in 17 matches in all competitions - and that against third-tier Talavera in the previous round of the cup.
Almeria are the team still without a win after 15 rounds in La Liga, with 11 losses and four draws.
They sit in last place with four points, seven away from relegation safety.
Seventh-placed Real Betis escaped similar embarrassment in the final minutes of their match against fourth-tier Villanovense.
Betis were losing 1-0 until Ez Abde scored in the 89th minute and Borja Iglesias sealed victory deep into added time.
Rayo Vallecano, 11th in the league, also needed two late goals - from Raul de Tomas and veteran Colombia star Radamel Falcao - to secure a 2-0 win against a fourth division club, Yeclano.
Las Palmas advanced thanks to a goal by Munir El Haddadi in the dying moments of extra time for a 2-1 win over fourth division Tudelano.
Real Sociedad, Sevilla, Alaves and Mallorca all advanced past lower-division clubs.
Australian Associated Press