If a landlord enters your flat when you’re not there and they failed to arrange the visit with you beforehand, it is against the law.
Similarly if the landlord entered your flat when you were present (it does not matter whether you let them in or they broke into the flat) and they stay in the flat against your will, they have committed a crime.
In such case you should report the circumstances to the Police as a crime. Depending on the situation you might do it either at the police station or, if the landlord is still in your flat, you can call the police and ask them to attend.
The possible penalties are: a fine, restriction of liberty or prison for even up to 1 year.