On the surface, "Pacific Heights" is a traditional genre film, a psychological thriller about a yuppie couple renting an apartment to a dangerous scam-artist who terrorizes them.

But it's also a strong-armed indictment against California rental laws, which, the film attests, allow tenants to take advantage of landlords.And despite some liberties in the script that occasionally stretch credibility a bit too far, it works rather well on both levels.

Melanie Griffith and Matthew Modine are the yuppie couple - not married, of course - who together buy a $750,000 fixer-upper in San Francisco's Pacific Heights district, reasoning that the two ground-floor rental units that come with it will help pay the mortgage.

They spend all their savings fixing up the place and rent the larger apartment to a sweet, older Japanese couple (Mako, Nobu McCarthy). But before he knows it, and against his own better judgment, Modine allows himself to be coerced into giving the second apartment to a fast-talking con man, played very well by Michael Keaton.

After changing the lock on the apartment door to prevent their inspecting the place, Keaton wastes no time making life miserable for Griffith and Modine, as well as their other tenants, with strange pounding noises that go on all night, a sinister companion who seems to live there more than Keaton and a dreadful way of harassing them with cockroaches. He also never pays a penny of rent.

Most movies would allow this to suffice as the leaping-off point, with little more than deadly cat-and-mouse games in the house making up the balance of the film.

But first-time screenwriter Daniel Pyne and veteran director John Schlesinger ("Midnight Cowboy," "Marathon Man," "Madame Sousatzka") have other things up their sleeve.

Keaton uses the law, of all things, to his own advantage, setting up hot-headed Modine in violent situations and then suing him. Later, a real audience-cheering sequence has Griffith taking the law into her own hands to exact a very sweet revenge on Keaton.

Unfortunately, Pyne's screenplay opts for a standard thriller ending that is a bit of a letdown, and there are moments when the Griffith and Modine characters are required to do things that don't seem very logical.

But "Pacific Heights" never cheats with the Keaton character, allowing him to be fleshed out and explaining his actions in a most satisfactory way. This is a refreshing concept, considering how many movies about psycho killers are content to simply let the character exist without any rhyme or reason. And it is certainly Keaton's presence that gives the film its greatest strength.

Playing this charming bounder with a dangerous, lethal edge, Keaton's performance will be a revelation for those who did not see "Clean and Sober" and have thought of him as little more than a comic actor who got lucky with "Batman." He gives a terrific performance here that lingers over the film even when he's off-camera for long stretches.

The rest of the cast is also quite good, with Griffith and Modine most convincing as a young couple buying their dream home and watching it turn into a nightmare. Griffith has what is essentially the lead role as the stronger of the two, but Modine is fine as a young man who impetuously reacts to crises instead of thinking things through.

There are a number of recognizable actors in smaller roles, most with very little to do - including an unbilled Beverly D'Angelo in perhaps the most effective supporting part. (Griffith's real-life mother Tippi Hedren - remember "The Birds"? - also shows up in a silent cameo as one of Keaton's scam victims.)

Despite overworking his circling camera so that it becomes noticeably self-conscious after awhile, Schlesinger does a pretty good job of moving things along and building tension.

All in all, "Pacific Heights" is flawed but fun.

It is rated R for violence, profanity and, in the film's opening scene, sex and nudity.