The city of Port Coquitlam says two bylaw enforcement officers were out of line when they spread chicken fertilizer where a homeless man typically camped in an effort to drive him away.

Officers had apparently repeatedly asked the man to move. But three weeks ago, when he came back to the same spot on a trail under the Lougheed Bridge bordering the Coquitlam River, they took action.

Officers said the trail is frequented by joggers and is close to an elementary school.

"We empower our staff to be creative and solve problems," said Dan Scoones, manager of bylaw services. "You have to in an organization like ours... at the end of the day it's not the right thing to do."

Homeless advocates were outraged at first, but say they are confident the incident won't be repeated.

"I'm fairly satisfied that it won't happen again," said Rob Thiessen, spokesman for the Hope for Freedom Society. "Our desire to work together will be enhanced."

Port Coquitlam says while the city doesn't have an official policy for dismantling homeless camps, it has taken steps to ensure that city staff's actions won't be repeated.

Last week, the city of Abbotsford apologized after city staff were caught spreading manure over a homeless camp.

With files from CBC's Matthew Black