"Today's decision is a huge victory for all of the people of California," said Joe Cotchett of Cotchett, Pitre & McCarthy, the firm representing Surfrider. "It affirms that great wealth cannot be used to circumvent and ignore the law. Everyone can again visit Martin's Beach."
Read MoreThe perfect tax? Proposed pied-a-terre tax
Khosla and his attorney released a statement Wednesday afternoon expressing disappointment in the court ruling. They added that they will consider their options for an appeal.
Khosla, who co-founded Sun Microsystems, bought the property, located south of Half Moon Bay, for $37.5 million in 2008. At one point, the beach had a sign welcoming the public, but that sign has since been painted over and the public was warned to stay out. According to the lawsuit, the gate to the beach was closed and locked in 2010 to keep the public out. The lawsuit states that since then, at least 100 people were kicked off the property for "trespassing."
More from NBC News:
SF Swimmers Pulled From Water Critically Injured
Public Access to All California Beaches May Become Reality
Group to Begin Raising Cash for 2016 Marijuana Ballot Measure
When the county told Khosla he needed a coastal permit to close the gate, he never applied for one. His attorneys argued that no permit was required to simply close a gate that was already there. But Surfrider sued Khosla, claiming that he ignored the law. The non-profit contended that Khosla be required to pay the maximum fine of $15,000 per day, which would amount to something in the range of $20 million.