Hearts have appointed Gary Locke as the club's new manager following three matches as interim boss.
Locke, who has been on the coaching staff since 2010, last month.
And the 37-year-old has the chance to land a trophy on Sunday as Hearts take on St Mirren in the League Cup final.
"It has certainly come as a bit of a surprise," said Locke. "Hopefully we can finish the week on an ultimate high by bringing a cup back to Tynecastle."
Former Dundee United boss and - both former Hearts employees - had both been linked with the role.
But director Sergejus Fedotovas told the club's website: "It was Gary Locke who scored more points among the board members."
Having served Hearts as a player, former Kilmarnock midfielder Locke returned to the Edinburgh outfit as part of Jim Jefferies' backroom staff.
He continued in the coach's role under Paulo Sergio and McGlynn and was promoted to oversee the first team for the defeat by Motherwell on 2 March.
His first win as manager came against St Johnstone three days later and a draw with Hibernian followed.
"John McGlynn has played a huge part in getting us to the final and for me to lead them out is a wee bit embarrassing but I'm delighted to get my future sorted out," added Locke on Hearts TV.
"I'm really looking forward to the cup final and the only thing on my mind now is to try to get the team to win.
"I think it was just important to get a bit of stability
"We have got to try to finish the season as well as we can and look towards rebuilding for next season as well.
"I'm really delighted. The opportunity has come a wee bit earlier than expected but I certainly aim to take it with both hands."
Edgaras Jankauskas and Darren Murray will assist Locke.
"I believe that it is right that Gary, Edgaras and Darren continue to be given an opportunity to build on the work they have begun," explained Fedotovas.
"Gary clearly has the same desire as a coach that he showed as a player for the club and with the support of Edgaras, Darren and the players has has an opportunity to deliver success to the club.
"Our decision provides certainty to everyone through to the end of next season and reinforces the focus we all have in trying to achieve a special chapter in the history of this club on Sunday."