CLEVELAND – The reeling and battered Boston Celtics were seconds away from matching their longest losing streak of the season.

Then Jeff Green saved the day.

Green hit the winning layup at the buzzer and scored 21 points Wednesday night, and the Celtics snapped a five-game losing streak with a 93-92 victory against the Cleveland Cavaliers.

It was obvious Boston, which had lost 7 of 9 coming in and was again without Kevin Garnett, needed something positive. A late-season slide had dropped the Celtics to seventh place in the Eastern Conference and it looked as if the skid would continue when Cleveland built an 86-72 lead with just over eight minutes to play.

“It was a huge win,” said Paul Pierce, who had 19 points and 10 rebounds. “We didn’t play well from the second quarter on but we found a way. It seemed like we were mentally fatigued and physically fatigued, but we put it all together at the end.”

Wayne Ellington scored 16 points to lead Cleveland, which has lost six straight, matching a season high, and 10 of 12.

Pierce hit a jumper with 32 seconds remaining to make it 92-91. Following a miss by Shaun Livingston, the Celtics regained possession and called a timeout with 9.2 seconds left. The next play, which began in the backcourt, seemed to set Pierce up for the final shot before Alonzo Gee knocked the ball loose in front of Cleveland’s bench with 2.1 seconds remaining.

The Celtics regrouped while a video review confirmed they had possession. Green took an inbound pass from Avery Bradley near the 3-point line, drove into the lane and scored over two defenders as time expired.

“Jeff wanted the ball,” Boston Coach Doc Rivers said. “He asked for it by the way he was looking at me in the huddle. He clearly wanted the basketball. I sensed that and everybody sensed that.”

“(Jason Terry) set a good screen on my man and Avery made a good pass,” Green said. “I just tried to be aggressive and get to the rim. I’m a player.”

The Cavaliers were coming off their worst defeat of the season, a 38-point loss Friday at Houston. Cleveland seemingly had control in the fourth quarter, but lost a game between teams decimated by injuries.

Boston played without Garnett, who missed his third straight because of inflammation in his left ankle. Guard Courtney Lee has also missed the last three games with a sprained left ankle.

Cleveland played without guard Kyrie Irving, who missed his seventh straight with a bruised left shoulder. Dion Waiters, the Cavs’ starting shooting guard, missed a third straight game with a sore left knee.

It was another frustrating loss for Cleveland Coach Byron Scott, whose team was outscored 21-6 with the game on the line.

“We were looking at the clock, playing not to lose the game instead of to win the game,” Scott said. “You have to look to win. You can’t hope the clock runs out and that’s what we kind of did.”

Brandon Bass scored a season-high 22 points for the Celtics, who lead eighth-place Milwaukee by 2½ games. Pierce also had eight assists but nearly negated all of them with seven turnovers. Jordan Crawford added 12 points for Boston.

The Cavs trailed by 12 in the second quarter but cut the deficit to 46-45 at halftime. They opened the third quarter on a 17-4 run to take a 62-50 lead before Boston trimmed it to 73-69 early in the fourth. A trio of 3-pointers by Daniel Gibson, C.J. Miles and Luke Walton, along with two baskets by Marreese Speights, stretched the lead to 86-72.