Kepu, getting his 106th Test cap, departed to a rapturous ovation in Parramatta in the 50th minute for his last international in Australia, and Samoa soon began to claw its way back into the contest despite losing halfback Scott Malolua to a potentially serious shoulder injury just before the break.
But Dane Haylett-Petty and Matt To'omua got late tries to halt any potential comeback by the visitors, wrapping up a win that ultimately flattered Australia.
The Wallabies looked to be running away with the contest in the first half, getting their first try after just seven minutes when Samoa lost possession with an overthrown lineout in its own 22, the ball eventually worked to Adam Coleman, who went over.
Marika Koroibete followed suit eight minutes later, receiving possession just inside the Samoa half, flattening Alapati Leiua before touching down by the left corner.
Adam Ashley-Cooper got in on the act just before the half-hour mark, jumping on to a bobbling ball after Haylett-Petty's incisive kick.
Lukhan Salakaia-Loto's converted score just prior to the interval gave the Wallabies a commanding 22-3 lead, but Samoa was fired up early in the second half, getting its first try of the contest when Dwayne Polataivao crossed after Afaesetiti Amosa broke away from a scrum.
Polataivao got a second soon after after a fine move. Leiua broke the line thanks to Ed Fidow blocking off Jack Dempsey and squared to Ahsee Tuala, who made the decisive final pass.
But the Wallabies upped their intensity again in the final 10 minutes to deny a Samoa comeback, Haylett-Petty spotting a gap and squeezing through, with Bernard Foley adding the extras.
To'omua wrapped things up in the final minute, with Australia heading to Japan in winning fashion.