Philadelphia 76ers star guard Allen Iverson agreed to undergo random drug-testing every month for two years and forfeit his handgun as part of a plea agreement today stemming from his arrest Aug. 3 on misdemeanor marijuana and gun charges.

If Iverson, 22, complies with all the conditions of the plea agreement, which includes 100 hours of community service and three years of probation, the charges will be dismissed.

If he fails to comply with all facets of the plea agreement, Iverson, the rookie of the year in the NBA this past season, could be brought back to court and sentenced to up to 12 months in jail or fined $2,500, according to New Kent Commonwealth's Attorney Linwood Gregory, who prosecuted the case.

"He has a great deal at risk if he violates any of the terms of this plea agreement," Gregory said. He cited Iverson's cooperation during his arrest as one of the reasons the defendant was allowed to enter into the plea agreement.

Iverson, who attended Georgetown University for two years before being chosen No. 1 in the 1996 NBA draft, hurriedly left the courthouse 20 miles south of Richmond without commenting. His lawyers, Tom Shuttleworth and Larry Woodward, also did not comment.

The only time Iverson spoke during the 10-minute court appearance was when New Kent General District Court Judge William Shaw III asked him if he understood the plea agreement.

"Yes, sir," Iverson answered.

In a statement released later by his attorneys, Iverson said: "I am relieved that these proceedings are now behind me and I will work hard to fulfill my obligations. I would like to take this opportunity to apologize to my family, my team, and my fans for any embarrassment that this incident may have caused them. I look at this situation as a learning experience and I hope to grow from it."

Team owner Pat Croce, who was critical of his point guard earlier this month following the arrest, was present and made a brief statement before climbing into a limousine with his public relations director, Jodi Silverman.

Croce said his attendance at today's court action "demonstrates that {Iverson} is part of the 76ers and that we support him."

Iverson was arrested by Virginia State Police at around 1:30 a.m. on Aug. 3 when his 1996 Mercedes-Benz, in which he was a passenger, was stopped for going 93 mph in a 65 mph zone on Interstate 64 about 20 miles east of Richmond. Iverson and two friends, driver Maduro Earl Hill, 32, and back-seat passenger Damon Stewart, 24, were on their way from a social function in Hampton to a recording studio in Richmond when they were pulled over, according to sources and state police.

State troopers found a marijuana cigarette on the front passenger seat where Iverson was sitting, according to Gregory. Police also found a Glock Model 21 handgun on the floor underneath Iverson's seat. A bullet clip was next to it.

Iverson was charged with two misdemeanors: possession of marijuana, punishable by 30 days in jail or a $500 fine, and carrying a concealed weapon, which carries up to a 12-month jail term or a $2,500 fine, according to Gregory.

Hill was charged with reckless driving and Stewart faces marijuana charges. Their court appearances are set for Oct. 21.

Iverson pleaded "no contest" to the gun charge. That means that he admitted to the judge he could be found guilty of the charge, but the judge refused to take action. If Iverson violates the agreement in the next three years, the judge can require him to return to court to face sentencing on the gun charge.

Iverson had purchased the gun legally in Virginia, but he did not have a permit issued by a Virginia court to carry the gun concealed on his person, Gregory said. The prosecutor said he agreed to the plea on the gun charge because it might have been difficult to prove that the gun was concealed: a state trooper saw it on the car floor, under Iverson's feet.

Gregory agreed to "nolle prose" the marijuana charge, which means he will not prosecute Iverson for it. But if Iverson violates his probation, Gregory can bring Iverson back to court and go to trial on the marijuana charge.

The agreement also prevents Iverson from owning or possessing a firearm for two years, forbids him to violate any laws in Virginia and elsewhere for three years and requires him to pay all court and drug-testing costs.

Iverson's attorneys must return to court by Oct. 28 with a plan to comply with the community service and the drug testing requirements. Gregory said the community service could be served at another location outside of New Kent, but that he wanted it to be of real service to someone.

"We're not talking about glamour work," Gregory said. "We're talking about working hours of pushing papers, pushing brooms or some type of work in the hospital. We're talking about something other than a basketball clinic."

In 1993, Iverson was sentenced to five years in prison stemming from his alleged participation in a brawl at a Hampton bowling alley. Then-governor Douglas Wilder released Iverson from prison after four months, saying the punishment did not fit the crime. The Virginia Court of Appeals overturned the conviction in June 1995.

Iverson attended Georgetown for two years, where he was named first team all-American as a sophomore. Iverson then left the university to enter the NBA. CAPTION: Allen Iverson, flanked by attorney Tom Shuttleworth, left, leaves court after his hearing on marijuana and gun possession charges stemming from Aug. 3 arrest.