Tech billionaire Sean Parker landed in hot water when he built an extravagant and elaborate wedding venue in a protected redwood grove in California and was busted just days before his nuptials.

However the 39-year-old Napster co-founder and first president of Facebook, managed to finagle a way save the wedding and avoid a lawsuit.

Parker paid a whopping $2.5million in violation fines and and lent a helping hand to the California Coastal Commission by using his tech smarts to create an app for them called YourCoast.

The app shows access and hike points along the California coast and was released on Thursday, according to the Los Angeles Times.

Parker, who was engaged to artist Alexandra Lenas, began his elaborate weddings set up - estimated to cost around $10million - in June 2013.

He installed a 20-foot gate, built bridges, a stone castle and Roman columns in a Big Sur redwood grove on a hotel property.

Facebook found president Sean Parker, 39, was busted for setting up a $10million wedding in a public redwood grove forest in June 2013, days before his wedding. He came to a special agreement with the California Coastal Commission where he paid $2.5million in violation fees and built an app for them

In the agreement, the extravagant redwood forest wedding was allowed to go on. Bride Alexandra Lenas pictured above with Parker at their $10million wedding in June 2013

The venue included a 50-foot stage for a band, a dance floor, and fur-covered beds for star studded guests like Lieutenant Governor of California Gavin Newsom, Senator Kamala Harris, Twitter CEO Jack Dorsey and singer Sting.

However, the site was a public campground that's not allowed to be closed for private events without permission from the local commission.

Officials investigated and found out that not only had Parker failed to get permission for the wedding, his team illegally closed the area to the public for six years.

Violating the Coastal Act comes with an expensive fine ranging from $1,000 to $15,000 per day.

The commission confronted Parker just days before his wedding.

The California Coastal Commission revealed that Parker violated the Coast Act which protects the public forest by building multiple bridges, a stony castle, and a dancefloor

These pictures show how Parker set up a stage and dance floor in the middle of the forest

He created multiple bridges and a 20ft gate in the Big Sur forest, despite not having a permit

This picture shows how he was building a stage adjacent to a creek in the forest

He created a stony platform jutting out of a redwood tree

This picture shows what the forest looked like before Parker began his elaborate wedding set up

And the two came to a unique deal, even though the property owner is at fault for permit violations.

The tech giant paid a whopping $2.5million in penalties - money that funded hiking trails, field trips, and local access to the Big Sur - and the wedding was allowed to go on after the Commission deemed there was no threat to the environment.

He also agreed to build an app called YourCoast that shows user 1,563 access points along the California coast that are tracked by the commission.

The app is a breakthrough for nature-lovers in the Western state, showing hard-to-find paths to beaches, parking areas, and access points for disabled visitors.

The California Coastal Commission unveiled the YourCoast app on Thursday.

Parker's violation turned into a rare high-profile case that proved to be a win-win situation settled by cooperation rather than a lawsuit.

Parker paid $2.5million in violation fees to the California Coast Commission and created the app YourCoast, which was released on Thursday, for them. The app shows a map of 1,500 access points along the California coast for locals to use

The billionaire entrepreneur was hit with the fine after he hired a landscaping company to build fake ruins, waterfalls, man made ponds, bridges and a gated cottage in the surrounding woods at the hotel

Bride Singer-songwriter Alexandra pictured above in a photograph taken by a friend

The couple's wedding cake can be seen among the forest setting at the celebrations in Big Sur

'We were spitballing ideas and mentioned an app. As soon as we brought this idea up, it really caught on and he just kind of ran with it. … It was one of those great opportunities that turned a bad situation into a really good thing,' Aaron McLendon, the commission's deputy chief of enforcement who met with Parker's team said to the local paper.

Parker told the Times that he was excited to work on the app because 'it would provide the greatest value to the public'.

The centerpiece of the app is a map of 1,563 public access points that the commission tracks along coastal California.

Clicking on a particular access point shows photos of the path to the beach - which can be hard to find - and whether it has amenities such as parking, access for visitors with disabilities, restrooms or fishing facilities.

Users can also submit updated photos or report violations to the commission. If people are visiting a remote area, they can save the map and information on their phone if they lose service.

'These settlement agreements show we’re open to anything. So long as promoting coastal access and protecting resources on the coast is at the forefront, then the sky’s the limit,' McLendon said.

Parker is still standing by with the Commission to help out with the rollout of the app.