Beckham is set to return to the Los Angeles Galaxy when his loan agreement expires in March.
“If Galaxy change ideas with Beckham then we will evaluate the situation and we will keep him,” Galliani told Sky Sport Italia.
“We have to see what happens, if he manages to free himself from his contract with LA Galaxy then we will be waiting for him with open arms.
“The player wants to stay with us, but he knows he has to return.
“We will buy him if he frees himself. Beckham will be happy as he has returned to play in a big club.
“The player and his representatives know that Milan are willing to buy him on a permanent basis.
“I don’t know his wage figures as we didn’t ask about this and I am not aware of any clauses in his contract with the Los Angeles Galaxy.
“Surely, Milan would take him on straight away if he was available, but he isn’t.”
“If Galaxy decide not to sell him then they will not. They have been really nice with us. The were kind and they have been very good. I want to thank Galaxy and I have no intention to fight with them,” added the chief.
“Both clubs decided that the player will go back in March, but we will see if Beckham is available to stay.”