A large barn for livestock will be built near a hospital despite objections to the structure.
Maesteg Community Hospital is worried animals could wander onto hospital grounds.
The barn is set to hold a total of 20 Welsh Black cattle, 70 ewes and one ram.
Bridgend County Council's planning committee approved the plans on Thursday.
A council planning document noted that there were grounds to justify construction of the barn.
It would improve welfare conditions for animals and allow the business to expand, the council document said.
However, the hospital said it was also concerned about noise from farm machinery, an increase in traffic noise and possible smells from farm animals.