Arsenal had not lost at home to foreign opposition since 2003 when Inter Milan claimed the points but their Emirates Stadium fortress looked anything but secure as they produced a woeful performance, managing just one effort on target.
They still looked like escaping with a 0-0 draw as Schalke, riding high in the Bundesliga after beating arch-rivals Borussia Dortmund at the weekend, wasted some great opportunities but Arsenal's luck finally ran out.
Dutchman Huntelaar rifled a shot past keeper Vito Mannone with 14 minutes remaining to give the Germans a deserved lead and Afellay, on loan from Barcelona, sent the boisterous away fans into party-mode with a tap-in second in the 86th minute.
Arsenal's disgruntled fans had already started heading for the exits and unless their team rediscover some form, what appeared to be a relatively easy passage to the last 16 may still become problematic with a trip to Gelsenkirchen next up on November 6.
The North London side have six points, one behind Schalke who look well-placed to take top spot with three games left.
"We seem to be lacking a bit of confidence with the ball," Arsenal's assistant manager Steve Bould, who was in charge as Arsene Wenger sat out the third and final game of a European touchline ban, told reporters.
"They are a really good side and it's a tough competition. A 0-0 would have delighted us.
"We've still got nine points to play for and I'm sure we'll perform a damn sight better next time."
Schalke boss Huub Stevens felt his side had been deserved winners.
"I was not happy with the first half, we were too cagey," he said. "We are happy with seven points, we have won two games in a row but there is a long way to go.
"In the second half we deserved to win the game. Huntelaar is Huntelaar, if he is in the box and you let him go he will get his goal."
"Arsenal are still the favourites for the group when they get some of their players back."
Arsenal did start reasonably brightly with Gervinho nearly getting a foot to a Lukas Podolski cross but the home side's confidence, rocked by a 1-0 defeat by Norwich City at the weekend, quickly drained away.
In his programme notes, Wenger described his side as having had "illusory possession" at Norwich and they again flattered to deceive in a sterile first half.
Missing the pace of the injured Theo Walcott and Alex Oxlade-Chamberlain and with Santi Cazorla struggling to impose himself in midfield, the home side hardly tested visiting keeper Lars Unnerstall before the interval.
When Schalke finally began to throw off the shackles they were by far the more threatening side.
They were unlucky not to have been awarded a penalty after 14 minutes when Afellay appeared to have his ankles clipped by Mannone as he raced into the area.
Much to the disgust of Stevens, Afellay received a yellow card for diving - a fate that also awaited Gervinho lat
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.