The case marks the second time in seven months that Shakur--whose music has generated more than $10 million in sales and whose films include John Singleton's "Poetic Justice"--has been prosecuted in Los Angeles.
The Atlanta entertainer was convicted in August of possessing a loaded and concealed firearm and still has four other cases pending against him in three states.
Shakur, 22, sat silently through most of the 90-minute sentencing in the Downtown courtroom as his lawyer and the prosecutor argued about whether he should receive the maximum sentence of one year in jail and a $3,000 fine. He was convicted Feb. 10 on single counts of battery and assault for attacking Hughes after following him to the Downtown set of a music video.
Shakur spoke only to ask the court to allow him to serve his time performing community service work.
In a courtroom packed with fans and camera crews, Los Angeles Municipal Judge George H. Wu also sentenced the rapper to a $2,000 fine and 30 days of community service.
Wu told Shakur he would have to serve an additional 24 months of summary probation and 20 more days of Caltrans work for the assault count if he fails to live up to the terms of his probation. The rapper is scheduled to be back in court May 10 to determine when he will report to jail.
The battery case is only the latest in a string of legal problems for Shakur, who made his start as part of Oakland rap group Digital Underground.
Shakur must return March 18 to New York for a hearing on a nine-count sexual assault case stemming from his alleged attack on a woman last November in a hotel suite there.
On April 18, he is required to appear in an Atlanta court to face an outstanding charge of simple battery for allegedly slapping a woman last summer when she asked him for his autograph.
The rapper also is awaiting the results of a grand jury investigation to determine whether he will face trial this summer in Atlanta on two counts of aggravated assault stemming from an October disturbance in which he allegedly shot and wounded two off-duty police officers.