Researchers compared people who lived in various areas of Wellington, New Zealand, and found that having the sea in sight every day was linked with lower levels of stress.
This association remained even after residents' wealth, age, sex and other factors were taken into account.
However, viewing green spaces -- such as grassy parks and forests -- did not seem to show the same benefit, according to the study published in the May issue of the journal Health & Place.
That may be due to the fact that researchers did not distinguish between types of green space, said study co-author Amber Pearson, an assistant professor of health geography at Michigan State University.
"It could be because the blue space was all natural, while the green space included human-made areas, such as sports fields and playgrounds, as well as natural areas such as native forests," she said in a university news release.
"Perhaps if we only looked at native forests we might find something different," Pearson added.
The findings might prove useful for city planners. For example, ensuring that a certain number of high-rise buildings or affordable homes in coastal cities are built in areas with ocean views might improve mental health, the researchers said.
Further research could determine whether views of large fresh bodies of water, such as the Great Lakes, have the same effect as ocean views, Pearson said.
The American Academy of Family Physicians has more on mental health.
Copyright © 2016 HealthDay. All rights reserved.