In New York to stand trial on sex charges stemming from an incident last fall, Shakur, 23, headed over to a recording session at a Times Square studio shortly after midnight last Wednesday. The rapper, his manager and another man were set upon by a trio of gunmen, one of whom had been waiting in the building’s lobby. The men demanded that Tupac and his crew lie on the floor and give up their jewelry. Shakur resisted, hurling insults and lunging for one of the crooks’ guns. His bravado was rewarded with gunfire. Two bullets grazed Shakur’s head, another punctured his left palm, another went through the back of his right thigh and nicked his scrotum.kh The thieves made off with his diamond ring and gold chains, worth $35,000. Nearby, police say, they found Tupac’s jacket, with a clip of 10-mm ammo and bags of marijuana – but because he wasn’t wearing it, no charges were brought. The star was rushed to Bellevue Hospital.

In court Wednesday, the judge instructed the jury in Shakur’s trial to disregard the rapper’s absence. By Thursday morning, Tupac had checked himself out of the hospital (to his doctors’ dismay) and made his dramatic entrance, although numbness in his legs drove him out of court and into another hospital before the jury announced its verdict. Shakur and a codefendant, they found, were guilty of sexually abusing a 20-year-old fan in a hotel room last November, but not of more serious sodomy and weapons charges he had faced. (The victim, who admitted fellating the star in a nightclub, told police that Shakur and three other men forced her to repeat the act during a subsequent visit to the rapper’s hotel room.) Shakur’s lawyers plan an appeal, but were nonetheless ““elated’’ with the trial’s outcome. Their client may get off with probation. He could also spend up to seven years in the slammer.

Tupac’s turn last week as both victim and victimizer may seem an odd coincidence, but the paradox fits into the contradictory reality of his life. His mother was a member of the Black Panthers, his father was anonymous, and Shakur did time even before he was born. Arriving a month after his mother’s acquittal on bombing-conspiracy charges, Tupac began learning the ways of the world on the streets of Harlem. He also discovered the love of theater and poetry that he brought with him as a teen when he and his mother moved to Baltimore. There, he auditioned his way into the Baltimore School for the Arts and composed his first rap song. After another move, to Marin County, Calif., Tupac succumbed to the rough culture of the streets. He dropped out of school and began dealing dope.

But at that crossroads, where many poor kids are driven south to stay, Tupac’s talent began to lead him to the top. He worked his way into the rap ensemble Digital Underground. Then he won a role as a psychopath in the 1992 urban drama ““Juice.’’ No less than The New York Times singled him out for praise. His first album, ““2Pacalypse Now’’ sold 400,000 copies. Two more successful albums followed, along with leading roles as a postman in last year’s eagerly anticipated but critically snubbed ““Poetic Justice’’ and as a gangster in this year’s ““Above the Rim.’’ Before the shooting, Tupac tore up the New York celebrity circuit, hitting nightclubs with new pal Mickey Rourke and taking a seat in the ““Saturday Night Live’’ audience with Madonna.

As his success escalated, so did his forays into the ““thug life,’’ advertised by the tattoo on his midriff. Two years ago Dan Quayle publicly condemned ““2Pacalypse Now,’’ after a car-theft suspect allegedly gunned down a Texas state trooper while listening to the anti-cop album. Last November, Shakur was arrested in the shooting of two off-duty policemen in Atlanta. Charges were dropped after witnesses said one of the officers shot first. A 1992 fistfight between Shakur and film director Allen (““Menace II Society’’) Hughes led to a 15-day jail sentence for the rapper this May. And, of course, there were the charges that brought last week’s conviction.

These incidents have only inflated Tupac’s reputation with inner-city kids, who see him as more freedom fighter than felon. ““I mean, look at him,’’ said 13-year-old Lol Hayes, hanging out last week in front of the Apollo Theater in Harlem. ““You can’t take him down, and there ain’t been nobody like him since Malcolm. He shot those white cops in Atlanta and didn’t miss a step. He gets shot here and keeps fighting.''

What exactly Tupac was fighting last week is a question that only adds to his mystique. The NYPD is investigating the shooting as a simple robbery gone wrong, but, says Sgt. James Coleman, ““we’re looking at the whole picture.’’ The rapper reportedly insisted to cops that he was ““set up’’ for the attack, and his lawyer hinted he left Bellevue because he didn’t feel safe there. At the weekend he’d risked hemorrhaging by dragging his injured body out of a second hospital after word of his presence leaked. And, constitutionally distrustful of police, he surrounded himself with a security detail from Louis Farrakhan’s bow-tied Fruit of Islam.

Did his attackers have a grudge against the star? ““People may be upset, but ain’t nobody surprised,’’ says one former Tupac employee. ““He’s pissed so many people off – men, women, white and black – that we were just holding our breath for this to happen.’’ Then again, the same veneer of toughness that makes him a hero to fans also makes him an inviting target for a gangster seeking to enhance his own ““props,’’ or street credibility, by knocking off a tough guy. Perhaps it was just someone who needed money and knew where to get it. A producer who recently finished work on Tupac’s upcoming album ““Crucified’’ says the star had too many hangers-on in the studio. ““Everyone knows that’s bad business because the word of where you are and what you have gets out and eventually it winds up in the ear of someone who needs extra cash,’’ he says. ““I told him several times he needed to chill with that.''

Who shot Tupac may remain a mystery for now, but last week’s developments are no surprise to many. ““Tupac is an alright down brother,’’ says Grammy-winning rapper/producer Dr. Dre, who cast Shakur in a recent video and who will himself begin serving time for parole violation next month. ““He’s just living the life most young brothers live but without the attention of the whole country. Young brothers are out there every day getting shot, going to jail, getting accused of s—. I don’t know why everyone’s acting like this is some new s— he’s on. That’s the way we’re living – money or not. Money don’t change where you come from.’’ And it can’t always change where you’re going.