HALIFAX -- A Crown lawyer says an accused murderer had a grudge against a man who was gunned down while delivering a pizza in Dartmouth more than seven years ago.

Randy Riley has pleaded not guilty to first-degree murder in the death of 27-year-old Chad Smith.

In her opening statement in Nova Scotia Supreme Court on Tuesday, prosecutor Melanie Perry said that on the evening of Oct. 23, 2010, a man called a pizza shop in Dartmouth to place an order for delivery, and that Smith was working that night as the driver.

She told the 14-member jury that about 45 minutes later, police found Smith lying on his back in a pool of blood in front of the address where the pizza was ordered from.

Perry says Smith had what appeared to be a gunshot wound to the upper right side of his body, and a red pizza delivery bag was found nearby.

She says Riley's friend later told police that before the shooting, Riley had told him he had a grudge against a guy who delivered pizza because he had allegedly beaten Riley years before.

Perry says on the same day of the shooting, the same friend told police he drove Riley and another friend to pick up what he believed was a gun.

The Crown lawyer says the friend told investigators that after the homicide, Riley had told him, "It had to be done."