The 23-year-old has been a Bayern target for weeks and the Bavarian giants are reported to be set to pay a Bundesliga record fee of €40 million for him.
German Sky broadcast images of Martinez, who currently plays for Athletic Bilbao, arriving in Munich at midnight on Tuesday before he completed the medical in the early hours of Wednesday morning.
Martinez trained with his Spanish team on Tuesday, but Bilbao on Wednesday demanded an explanation and insisted they had not authorised his trip to Germany.
"Athletic Club wish to state that they did not at any point authorise Javi Martinez's trip to Munich on August 28," read a statement on the club's website.
“Athletic Club have asked for an explanation for the player, who still belongs to them."
The defensive midfielder has made eight appearances for Spain and he came off the bench for Spain briefly at both the 2010 World Cup and Euro 2012.
Bayern have already strengthened their squad this season with midfielder Xherdan Shaqiri arriving from FC Basel, striker Mario Mandzukic from Wolfsburg and Brazilian defender Dante from Mönchengladbach.
With the transfer window set to close on Friday, fans in Hamburg were on Wednesday hoping that HSV would be able to raise enough cash to buy Rafael van der Vaart from Tottenham Hotspurs.
Van der Vaart is something of a hero in Hamburg, having played for HSV between 2005 and 2008.
And he says he is ready to return to Hamburg, the Hamburger Morgenpost newspaper said on Wednesday. But the bad news, the paper said, was that Spurs boss Daniel Levy would not let him go for less than €18 million – far too much for Hamburg.
The Hamburgers have €10 million, the paper said – and could probably bump this up to €12 million to get van der Vaart - but even that would be well short of the Spurs price tag.
“If two parties are so far away from each other, there is no basis for negotiation,” said HSV trainer Thorsten Fink. But he said he was still hopeful that Levy would let them have the Dutchman.
The Hamburger Morgenpost said Levy was in the midst of an expensive shopping spree for players. Although he had just sold Luka Modric to Real Madrid for €30 million, Levy would need more money to buy the players he had in mind and was ready to sell van der Vaart.