BOSTON (AP) _ John Calipari, who took over the University of Massachusetts team in 1988 and built it into a national powerhouse, is leaving to coach the New Jersey Nets, his agent said today.

Calipari, whose team was ranked No. 1 for most of the 1995-96 season and went to the Final Four, agreed late Wednesday night to join the Nets, according to agent Craig Fenech.

``Everybody wants to test themselves at the highest level,'' Fenech said. ``He knew someday he would, but he didn't know if it would be this year, next year, or when. We just knew it eventually would.''

Calipari and the Nets had hammered out most of the deal by Monday, said Fenech, who would not disclose contract terms.

A UMass official who requested anonymity, confirmed that Calipari told UMass chancellor David Scott this morning that he's leaving to join the NBA team.

Calipari, who for weeks had insisted he had no plans to leave UMass, was not immediately available for comment.

New York radio station WFAN reported Wednesday night that Calipari has agreed with the Nets on a five-year deal to coach the team.

The report came six days after Kentucky coach Rick Pitino rejected the Nets' offer of around $25 million to become coach, general manager and part-owner.

Calipari, 37, owed his UMass job to Pitino, a UMass graduate who championed Calipari's cause on the 1988 search committee that hired him.

Calipari's exit also came two days after a scandal broke involving UMass's best player last season, Marcus Camby, and a Hartford, Conn., agent.

Camby, who left the school to make himself avaiable for the NBA draft, admitted accepting improper gifts as a college player, and filed a criminal complaint in connection with allegations he was blackmailed by a would-be agent trying to woo him as a client.

The university has begun an investigation. Severe sanctions are likely only if it is found the university knew of the violations. A range of sanctions could be applied, including suspension of the program.

Fenech had talked to both the Nets and the Philadelphia 76ers on behalf of his client.

Perhaps the NBA's most luckless team, the Nets were spurned by Pitino during his golfing trip to Ireland with Kentucky boosters. In landing Calipari, they snared a young, high-profile coach they hope can bring some luster to the franchise.

New Jersey has been without a coach since Butch Beard was fired in April after posting a 30-52 record in each of the last two seasons.

Under the 37-year-old Calipari, the Minutemen have gone 193-71 and won the last five straight Atlantic 10 regular season and conference championships. Last season, UMass went 35-2, losing to Pitino's Kentucky Wildcats in the NCAA semifinals.