Set boundaries. Start the conversation and tell them what you want and ask them what they want. (They also said that if the friend could not accept that they would cut ties with them)
If someone treats you like his girlfriend, that probably means they want to spend a lot of one-on-one time with you, buy you gifts or meals, give you compliments, and maybe even try to be physically or sexually involved with you. You can accept all of those things as a friend, although that would likely send a mixed message and make that person think you are a girlfriend. And if he wants to treat you like his girlfriend but not commit to having you as his girlfriend (receiving the benefits without the commitment), then it is important that you set clear boundaries and verbally communicate what you are ok with, and not ok with. A true friend (and boyfriend) will respect your boundaries.
Just because he gives you a gift or asks you to dinner does not mean you are obligated to say yes, do the same in return, or be more than just friends. And you are not obligated to explain your reasoning. Learn to say no without feeling you the need to explain yourself!