The final 2km, with a series of short steep ramps, was too difficult for the purest of sprinters like Dylan Groenewegen (Jayco-AlUla), who gave up the overall leader's jersey.
But Wærenskjold, who won the U23 time trial world title in September, survived and made use of a strong lead-out before getting the better of stage 2 winner Jonathan Milan (Bahrain Victorious).
Cees Bol (Astana Qazaqstan) claimed the final spot on the podium for a second day in a row.
With Groenwegen dropped, Milan inherits the green jersey as overall leader, with Bol moving up into second at eight seconds. Max Kanter (Movistar) is now third at 16 seconds.
"I have waited for this for some time," said Wærenskjold. "I've been good in the under 23 class but hadn't managed to take a pro win, so this is really fantastic."
The 159km stage started in Al Manshiyah and headed to the hilltop finish of Abu Rakah, though tracking a different final road than the corresponding stage from last year.
Although there was a vague threat of crosswinds throughout another ride through the desert, a near full peloton arrived for the uphill final few kilometres.
After an initial false flat, the road kicked up with two kilometres to go, with Pascal Ackermann (UAE Team Emirates) launching a speculative attack. Zdenek Stybar (Jayco-AlUla) countered and went solo but was tracked down by Santiago Buitrago (Bahrain Victorious), who won here last year. The pair came together for the final kilometre but didn't work together and a bunch of around 30 riders regrouped to contest the sprint.
Uno-X formed a two-man lead-out for Wærenskjold but Milan looked to repeat his trick from 24 hours previously with another ambitious long-range sprint.
Wærenskjold hit out and set about dragging Milan back, drawing level with 50 metres to go on the false flat finish before moving clear to celebrate a breakthrough moment.
"I knew when the guys went really hard on the bottom of the climb I couldn't follow. So I surfed a bit on the peloton to save myself for a sprint," Wærenskjold said.
"We did it perfectly. Today we took the right-hand side [of the road]. Finally we got the wind from the left so we got less wind compared to yesterday when we did really bad at the end. We learned from that and today we did it."
Comments / 0