The Danish women were level with their opponents in the Group B preliminary clash for the majority of the game, but four goals in the final few minutes took them over the winning line, with Sweden unable to match them.
In a tight group, where all six teams harbour realistic hopes of getting through, an early win for Denmark will give them a solid footing for their next outing with Republic of Korea on Monday.
And pivot Mette Melgaard was delighted her side came out with the right result.
'Before we came here we had some bad matches but we played like a team and fought hard,' she said.
'It gives us confidence for the next game, it is so nice to get a good start in the Olympics, we are loving being here.'