VICTORIA -- A 17-year-old boy has been arrested after a pair of random and unprovoked hammer attacks in Courtenay.

The first attack occurred on March 15, when a man was struck with a hammer by a stranger while on a popular walking trail.

"He just kind of took exception to something,” the victim told CTV News. “He pulled out a hammer, like a small roofing hammer, out of the front of his pants… He swung it and I put my forearm up to block it and it kind of grazed off just below my elbow."

Five days later, the Comox Valley RCMP responded to a similar assault in an alley behind the Courtenay post office.

In both attacks, the victims reported nodding politely at the stranger who then pulled out a hammer and struck them.

Police say both victims were lucky to avoid serious injury.

“The assistance we received from the public was instrumental,” said Cpl. Matt Holst of the Comox Valley RCMP in a statement Wednesday announcing the arrest.

“These attacks were concerning to everyone,” Holst added. “Residents and businesses went out of their way to assist the investigation by providing surveillance footage.”

The 17-year-old boy from the Comox Valley is currently in custody pending a court appearance.