It has become synonymous with chaotic project management, wrought with a series of failures, disruption and a massively inflated budget.

However the inquiry into Edinburgh's beleaguered trams project has heard the council had learned "important lessons" from the process.

A lawyer for the local authority said current plans to extend the network to Newhaven represented a chance for the council to show that past problems have been addressed.

The three-year-long Edinburgh tram inquiry also heard claims the project was not a failure, as closing submissions were submitted this week.

The £9 million probe, chaired by Lord Hardie, also heard that the city had been "enhanced" by the existence of the system.

The statements came as lawyers and the local authority aired differing views over who was responsible for past problems within the notorious project.

Initially in 2003, £375 million was earmarked by the then Labour-led Scottish Executive for two tram lines to link the city centre.

However in the years which followed, the eventual cost of the project skyrocketed to £776 million -- £231 million over budget -- and was three years late on its launch in 2014.

The original "network" was also cut in half, consisting of only one line stretching 8.5 miles.

Added to this, £200m in interest on a 30-year loan taken out by the council means the total cost could reach in the realms of £1bn.

Bitter contract disputes also plagued the process.

At one point main contractor Bilfinger Berger downed tools amid payment claims, with former Transport Initiatives Edinburgh (TIE ltd), chairman, David Mackay, famously branding the project "hell on wheels".

In closing submissions to the inquiry, Roy Martin QC, for City of Edinburgh Council, said: "Council has already learned important lessons from the tram project and awaits the findings of the inquiry in order to consider what further lessons can be taken on board for future projects."

Around 6.6 million used the current system in 2017, a year on year growth of 19 per cent.

Councillors are due to make a decision towards the end of 2018 on whether to go ahead with a proposed £165 million extension of the tram route down Leith Walk to Newhaven.

"Although the lessons learned by the council will be applicable to all projects which it undertakes in the future, the Leith and Newhaven tram project is clearly an opportunity for council to demonstrate that past issues have been recognised and addressed," the QC added.

Mr Martin said lessons learned so far cover areas such as project planning and governance.

He added: "The council is aware of how the tram project affected local citizens and businesses. Lessons have been learned in relation to minimising traffic and other disruption."

Mr Martin told the probe that the council had sought advice from lawyers DLA Piper over the trams contract.

"The council relied on that purported advice but the advice was not complete and it was not accurate," he told the inquiry.

However, Roddy Dunlop QC, for DLA Piper Scotland, said council assertions that the project difficulties were "mainly DLA's fault ... part company with reality".

He said: "If, as certain (council) members claimed, they didn't understand the blindingly-obvious fact that this was no fixed-price contract, the fault for that lies with Edinburgh Council legal and the officers within other council departments. It certainly cannot lie with DLA."

He pointed to "multiple reasons" for the project being late and over budget, and insisted that "none lies at DLA's door".

He added: "The things they are criticised for not doing would not have avoided the delays or the added costs."

Mr Dunlop also told Lord Hardie: "The evidence taken as a whole shows that Edinburgh has been left with a valuable asset, hence, no doubt, why the line is to be extended.

"Your Lordship should not start with any assumption that the project itself has failed. It has not. Edinburgh itself is enhanced by the existence of the tram system."

Meanwhile, the inquiry heard that the 2007 decision by the Scottish Government's then finance secretary John Swinney to take Transport Scotland off the board in charge of the tram project was "entirely sound".

Jonathan Barne QC, for Scottish ministers, said the move was to ensure clarity of roles between those delivering project and those funding it.

He said: "The suggestion from some appears to be that Transport Scotland's withdrawal orphaned the project, leaving the council and (arms-length company) TIE to fend for themselves.

"Any such suggestion is, I submit, without basis."

He went on: "There is not a single piece of direct evidence to show that the withdrawal of Transport Scotland from the tram project board, of itself, had any direct impact on the outcome of the project in terms of access to expertise, effective project management, or savings."

The public hearings have now come to an end, although the inquiry heard it is possible that further sessions may be required, depending on the final outcome of a legal action over certain productions.

Lord Hardie, who looked at in excess of six million documents as part of the probe said: "Clearly, the inquiry will have to reflect upon all of the evidence that we have received and a report will be prepared and submitted in due course."