Maresme was long overlooked by foreigners who favored trendier areas to the north and south of the city. Now deal-hungry house hunters from abroad are snapping up homes on villages near the beach.

Wealthy Catalans who have long flocked to Spain's Maresme coast now have to share their favorite vacation spot with a wave of foreign home buyers. They are all drawn to the quaint villages that dot the roughly 30-mile-long coastline north of Barcelona, and the easy access they offer to the Mediterranean beach and the mountains.

Buyers from Northern Europe, Russia and the U.S. have been purchasing homes in recent years at prices that would be the envy of the more fashionable coastal towns to the south of Barcelona, such...