The men's race saw some of the leading contenders struggle early on with Czech rider Ondrej Cink eventually battling to the front with Brazilian Avancini.
Cink soon fell back with a heart problem, leaving reigning champion Schurter and Swiss compatriot Mathias Flueckiger to move up alongside Avancini.
Flueckiger looked on track for victory, however the Olympic and world champion summoned a great last-gasp sprint to seal his first 2019 XCO World Cup win.
Avancini was 12 seconds behind for his best result with Italian Gerhard Kerschbaumer and Frenchman Jordan Sarrou rounding out the men's podium.
Schurter, 33, said: "It was super tough. It is the hardest to race at high altitude. You are always suffering. The sprint worked out pretty well."
Avancini, 30, explained: "I am stepping up and a positive outcome for the weekend. I was not far from the win. I just missed the move towards the end."
In the women, Terpstra became the first ever Dutch women's XCO winner on the World Cup circuit with a gutsy victory over reigning champion Jolanda Neff.
Terpstra had the lead for the majority of the race with Swiss star Neff unable to bridge the gap as Ukrainian Yana Belomoina hit back superbly for third place.
Terpstra, 28, said: "I knew I prepared very good for the altitude because normally it is a weakness for me. I also wanted to take a risk. I did my own race, my own pace."
Sweden's Olympic champion Jenny Rissveds produced a brilliant ride for fifth as she struggled to contain her emotion following her 2019 return from depression.
Rissveds revealed: "I can't stop crying. I did not believe that I could come back and be up here. From Nové Město until now, I really started to work on my mind game again. It is incredible what your head can do if you believe in yourself. It is just amazing."
1. Nino Schurter SUI 1:19.34
2. Mathias Flueckiger SUI +0.02
3. Henrique Avancini BRA +0.12
4. Gerhard Kerschbaumer ITA +0.27
5. Jordan Sarrou FRA +0.45
UCI MTB World Cup XCO men's standings:
1. Nino Schurter SUI 835 points
2. Mathias Flueckiger SUI 755
3. Mathieu van der Poel NED 700
4. Henrique Avancini BRA 655
5. Jordan Sarrou FRA 553
Vallnord UCI MTB World Cup XCO women's result:
1. Anne Terpstra NED 1:22.59
2. Jolanda Neff SUI +0.38
3. Yana Belomoina UKR +0.51
4. Daniela Campuzano Chavez Peon MEX +0.58
5. Jenny Rissveds SWE +1.03
8. Kate Courtney USA +2.04
UCI MTB World Cup XCO women's standings:
1. Kate Courtney USA 890 points
2. Jolanda Neff SUI 815
3. Anne Terpstra NED 645
4. Anne Tauber NED 499
5. Yana Belomoina UKR 486