A pair of homeless people lurking in a Queens subway tunnel led to three trains being stuck between stations for about 40 minutes on Friday afternoon.

The incident was initially sparked by a broken signal, which led to a trio of stuck trains in the tunnel near Roosevelt Avenue at about 1:15 p.m, said MTA spokesman Kevin Ortiz. As MTA workers were flagging the trains toward the station, the operator of the first train noticed two people wandering along the tracks. The crews immediately stopped all three trains to look for the people, who workers thought might have been disgruntled straphangers who had jumped off one of the three trains, said Ortiz.

“The train operator of the first train observed two individuals in the tunnel who he originally thought were self-evacuating,” he said. “Trains had to be stopped while they looked for the two individuals.”

But when they finally tracked them down, they realized they were homeless people walking through the tunnel. Emergency services removed them from the tunnel, said Ortiz.

The passengers on the three trains were stuck between stations for about 40 minutes, said Ortiz.

Riders on the trains were angry that their commute was disrupted.

“It took the train 40 minutes to go two stops and it wasn’t even rush hour,” said Clarissa Ruiz of Jackson Heights. “I can’t believe how bad it has gotten.”

The end of the work week was marred with increasingly frequent MTA incidents. Earlier in the day, a southbound Q train derailed in Brighton Beach in Brooklyn during the morning’s rush, snarling subway traffic in the area for hours.