The 2008 world champion easily pulled away from his rivals on a dry track with a three-stop strategy to win the race by 17.3 seconds, his 23rd career victory and first in Malaysia at the eighth attempt.
"Incredibly happy, it's my eighth year here [at Sepang] and finally I got that win," the Briton said after taking the chequered flag for his second victory for Mercedes since he joined them last year and first points of the season. "It's quite special to get a one-two, I haven't had many in my career, so that makes it even more special. A great day."
Rosberg, who won the season opener in Australia two weeks ago, started in third place but squeezed past quadruple world champion Sebastian Vettel into the first corner and was able to keep the Red Bull at bay and stay top of the driver standings.
It was Mercedes' first one-two since 1955, their last year as a works team before 2010. Rosberg almost touched the wall as he took Vettel at the start and struggled to manage his rear tyres in the early stages as the two Germans remained close before the Mercedes driver pulled away over the closing laps.
The second-place finish moved him on to 43 points in the standings, 18 clear of Hamilton with Ferrari's Fernando Alonso third on 24 points after his second fourth place of the season. Mercedes took the lead in the constructors' standings.
"I had a really good start," said Rosberg. "I got away well and thought Sebastian was going to put me into the wall but he stopped just before so thank-you for that. My heart skipped a beat a little bit but it was OK. I was trying to chase Lewis but he was a bit too quick today."
Vettel finished third, 7.2 seconds behind Rosberg, for his first points of the season following an early retirement in Australia as he struggled to make an impact on the Mercedes pair without the rain that helped his qualifying bid on Saturday.
Having endured a tricky time during off season testing, Vettel was delighted to make the podium. "Congratulations to them, they are bloody quick, the package they have is very, very strong," Vettel said.
"For us there is mostly positives. It's much better than what we expected during the winter."
Alonso was involved in a tight battle with Force India's Nico Hulkenberg in the closing stages before finally overtaking the German although he will be disappointed that once again the Ferrari looked well short of challenging the Mercedes.
McLaren's Jenson Button was sixth with Felipe Massa of Williams seventh just ahead of team-mate Valtteri Bottas after the Brazilian refused to yield to his Finnish team-mate despite team orders to do so.
The row, at a circuit where team orders blew up into a major controversy last season at both Red Bull and Mercedes, threatened to cause friction for the coming races between the new team-mates.
McLaren's Danish rookie Kevin Magnussen and Toro Rosso's Russian newcomer Daniil Kvyat rounded out the top 10 of a race that suffered just a couple of light drops of rain despite concerns about possible thunderstorms.
Red Bull's Daniel Ricciardo, who was disqualified in Australia pending an appeal, missed out on points for the second race in a row after a disastrous third pit stop when he was in fourth.
The Australian pulled away before his front-left wheel was fully attached with engineers sprinting down the pitlane to push him back and fix the issue.
Ricciardo was then given a 10-second penalty for the unsafe release but his chances of points were already over after he shredded a tyre and damaged a wing shortly before the stewards' decision and he retired before the end.
"Deep down I'm really disappointed but at the same time there's a little bit in me which is happy because I think I've come out how I wanted to," the Australian said, reflecting on his start to the season.
"I still want to improve but we've started off on the right foot. So for that I'm pleased. I know a little bit of luck will turn around soon and I'll get my revenge and get some points."