The Strasbourg court backed a Romanian engineer, Bogdan Barbulescu, who was fired over a decade ago after sending messages to his brother and fiancee using his workplace Yahoo Messenger account.
It found the company had infringed Mr Barbulescu's right to privacy by not informing him in advance that it was recording the messages he sent on the account.
Some of the messages were described as being "of an intimate nature".
Neil Brown, a solicitor at specialist digital law firm Decoded Legal, told Sky News that "in this particular case, the monitoring violated the employee's fundamental rights.
"However, the judgment recognises that there are legitimate reasons for monitoring employees' use of IT systems, and gives useful guidance as to how employers can tackle the issue in a lawful manner."
In order to comply with the European Convention on Human Rights (ECHR), companies must let their staff know in advance if their communications are being monitored.
The monitoring must also be carried out for a legitimate aim and limited to what is necessary and proportionate to achieve that aim.