North Carolina's Mike Pepper sank an 18-foot jump shot from the left side with nine seconds remaining last night to lift the Tar Heels to a come-from-behind 58-57 victory over Wake Forest and set up a Maryland-North Carolina matchup for the Atlantic Coast Conference championship at 8:30 tonight at Capital Centre.

The Terrapins trounced top-seeded Virginia in the night's other semifinal, 85-62.

Carolina's victory wasn't a pretty one, but the Tar Heels got tough when they had to. They trailed most of the game and were down, 55-50, with 5 1/2 minutes remaining, but Pepper, a 6-foot-3 senior guard from Vienna, Va., teamed with freshman Sam Perkins to come up with the plays Carolina needed down the stretch. Perkins was the game's high scorer with 18 points. Pepper and James Worthy each had 12. Frank Johnson and Mike Helms had 14 apiece for Wake Forest.

Pepper's 20-footer cut Wake's lead to 55-52 and after Jim Johnstone missed two free throws, Perkins scored on a turnaround jumper to get the Tar Heels within a point.

Wake tunred the ball over on its next possession and Perkins scored again as he grabbed Pepper's miss. That gave North Carolina a 56-55 lead with 4:12 to play.

Wake then surprisingly held the ball for nearly three minutes before taking a shot. Then the one they got was a difficult jumper by Alvis Rogers over Perkins. But it went in to give Wake the lead back at 57-56 with 1:32 left.

Carolina then held the ball for nearly a minute before Al Wood put up an errant jumper. Perkins, who seemed to be everywhere all game long, grabbed the rebound, his 15th.

Jimmy Black forced up a long jumper with 32 seconds left and there was a wild scramble for the rebound. Pepper finally came up with it in Carolina's backcourt with 25 seconds remaining.

Carolina called a timeout to set a play.

"He (Carolina Coach Dean Smith) just told us that if we felt one to go ahead," said Pepper.

Pepper felt it from the left side with nine seconds left and it hit nothing but the bottom of the net.

Wake Forest immediately called time out.

Smith guessed that Frank Johnson would be the one Wake wanted with the ball, so he told Pepper to foul him with about four seconds remaining.

Pepper followed orders perfectly and since it was only North Carolina's sixth team foul, it was a nonshooting infraction. Wake called another timeout at that point.

Mike Helms in-bounded the ball to Johnson, who broke out high from the baseline to get the pass. Pepper played man to man on Johnson and the other four Tar Heels played a zone. Johnson dribbled to his right and then threw up an off-balance jumper from about 15 feet that missed badly as the game ended.

The teams had completely different strategies. Carolina pounded the ball inside to Perkins and Worthy while Wake was content to put the ball up from outside. Wake shot 65 percent in the second half and 58 percent for the game, to only 43 percent for North Carolina, but the Tar Heels got off 17 more shots and outrebounded Wake, 40-19.

North Carolina was favored, even though Wake had won two of their three meetings this season, including a 16-point blowout in Chapel Hill in their last encounter.