It is one of the questions every tenant asks sooner or later, usually after a knock at an awkward hour: does the landlord actually have the right to come in? The honest answer is more balanced than either side expects. You have strong protection of your quiet enjoyment of the home, and the owner still has legitimate reasons to be let in now and then. The whole thing settles on two words, notice and reason. Here is where the lines fall.
No. There is no general right for a landlord to walk into a home you rent in Spain. The law protects your quiet enjoyment of the property, and possession of the inside is yours for the term of the lease. The owner keeps the right to maintain and repair the building and can ask to come in for that, but a request is exactly that, a request, and it has to be reasonable in time and purpose. A contract clause that pretends to hand over unlimited access looks threatening but carries less weight than the paper it sits on.
Spanish law does not fix a single number here, which surprises people who expect a rule like 24 hours written into the statute. In practice, well-drafted contracts set a window for visits, most often 24 or 48 hours, arranged at a time that suits the tenant. The principle is that a visit is agreed, not sprung. If your contract says 'at any time' or 'without prior notice', treat that as a warning sign, and remember you can still insist on reasonable notice even if you have already signed.
Repairs are the clearest case. Article 21 of the LAU puts the duty to keep the home fit for use on the landlord, and you cannot reasonably refuse access when a genuine repair has to be done. That said, 'genuine' carries the weight in that sentence. You are entitled to know what is being fixed and roughly when, and to have the tradesperson arrive at an agreed hour. Emergency work, like a burst pipe or a leak reaching the neighbours, can justify quicker access. An ordinary inspection or a quote is not an emergency and should wait for a sensible moment.
If the owner is selling, they will want viewings, and this is where tenants often feel pushed. You are not obliged to open the door to strangers at short notice. You can set sensible times, evenings or weekends for example, and ask for a day's warning. Refusing everything is a poor idea if you might want a reference later, but accepting everything at the owner's convenience is not required either. A middle ground, agreed in writing and kept to, takes the friction out of it. Remember that a sale does not end your lease, so you are negotiating comfort, not survival.
You can decline entry when there is no legitimate reason, when the notice is unreasonably short, or when the person at the door cannot show who they are or why they are there. Nobody has the right to let themselves in with a spare key without your agreement. If an owner or an agent keeps appearing unannounced, write down the dates and put your objection in writing. For anything that escalates, a burofax creates a dated record, and a dated record is what changes the tone of the next conversation.
Before signing, read the access clause and, if it is vague, ask for a specific notice period. Once you are in, keep communication by email or message so there is a trail. For owners the mirror advice applies: agree visits in advance and keep records, because a documented relationship avoids most disputes before they start. In our experience most landlord and tenant friction in Spain is not really about the law, it is about surprises. A little notice removes nearly all of it, and it costs nothing.