The left-handed opener, 36, who played six Tests for England, last appeared for his county in July 2016 before he was diagnosed with a cancerous tumour.
He immediately started treatment and had a successful operation.
Carberry scored exactly 100 off 121 balls in Hampshire's game against Cardiff MCCU at the Ageas Bowl.
Having resumed pre-season training in January and going on a tour of Barbados with the county, Carberry released a statement on Tuesday thanking people for their support and urging the media to continue "respecting my privacy in dealing with my illness".
Hampshire begin their County Championship Division One season against Yorkshire at Headingley on Friday.
Michael Carberry scored a century in his first competitive outing for Hampshire since returning to cricket after undergoing treatment for cancer.