When a person is interested only in a casual relationship, they often let the other person know before they develop feelings. It is an easy way for both of them to have some fun together, so there is no reason for them to give up the hunt for someone special. This works well when their only emotions are a light affection for each other, but the person who claimed to only want a temporary relationship might find they are suddenly in love with their current partner.
It can come as a total shock to this person when they realize their feelings are involved, and they might fight it at first. Their idea of the perfect person for them might not fit the person they are seeing right now. They might believe they should wait until they are older, or they could feel that settling down is nothing more than settling for what society wants.
Resistance can be hard when feelings arise, and the intensity of them might be very surprising for a person who has never felt compelled by anything other than their own temporary pleasures. They could find they are beginning to think of being with the other person far into the future, and it can be painful to think they could lose them. Dealing with these emotions could cause them anxiety, and they might begin withdrawing from the relationship.
When it comes down to a feeling of loss, the person has only their own lack of foresight to thank. Those who are intelligent will discuss their dilemma with the other person, and they might be surprised to find they are willing to explore the possibility of a true relationship between them. If the other person took them at the first word, they could also understand that feelings can change over time and agree to remain.