Sky Sports revealed earlier on Friday that the Bluebirds were in negotiations with the Wales international, and discussions have now come to fruition.
Bellamy officially put pen to paper on Friday after having successfully undergone a medical on Thursday.
The Championship side have not stated the transfer fee they have had to pay Liverpool.
The 33-year-old played for Cardiff in the 2010/11 season on loan from Manchester City and earlier this summer had expressed his desire to return to his hometown club.
Speaking of the transfer, the Welsh club’s chief executive Alan Whiteley enthused: “I am sure that Liverpool will agree that their loss is this football club’s gain and that Craig’s return will be met with huge excitement and enthusiasm by all Cardiff City fans – and as the perfect backdrop to the start of the new season.”
Bellamy will wear the No.39 shift at Cardiff and will join his team-mates for training next week.