With Osaka having lost in the quarter-finals to Belinda Bencic, whom Halep laboured past in three sets in the last four, the Romanian would have reclaimed the No.1 ranking with a victory on Sunday (AEST).
But Bertens brushed aside the favourite, making history with a hugely impressive display, becoming the first woman to win the Madrid Open without dropping a set.
Bertens will now rise to No.4 in the world rankings, while French Open champion Halep's wait for a third Madrid title goes on.
Having overcome three former Major champions to storm into her second successive Madrid final, Bertens started somewhat sluggishly, with Halep breaking serve to take a 4-2 lead.
The Dutchwoman fought back, though, winning four consecutive games to take the first set 6-4, hitting nine winners and claiming three out of five break points.
Bertens had hit her stride, and after breaking Halep in the first game of set two, held her own to take a 2-0 lead.
Halep was excellent off both the backhand and forehand sides as she hauled herself level, but Bertens stepped up the intensity once again to retake the initiative.
Having saved a break point to hold serve and make it 5-3, Bertens also made sure of the win with a deft drop-shot that Halep could only send out of play.