Some weeks ago my girlfriend and I invited another couple to our home, which is about 15 minutes away from theirs. I hadn't seen them in years and my girlfriend didn't know them at all. So they got to know each other. We had a nice conversation and everything.
Around 6 PM (they arrived at 1 PM) I was starting to get nervous because I had an important meeting with a friend at 7 PM I could not postpone. I made a mistake by not telling the other couple in advance that I had to do things at 7 PM, because I didn't expect them to stay that long in the first place. They enjoyed our company and didn't seem to want to leave soon.
Finally (and luckily) somewhere around 6.45 PM they decided to leave. I kind of supported them in their intent by not saying things like "Oh, what a pity. You could have stayed a little longer." but rather "Okay, it's getting late, we have to prepare for tomorrow's work day." in order to make them leave immediately.
The whole time I was wondering how to tell them to leave without making them feel bad. I was thinking about how bad my excuse would sound, although it was true. How can one handle such a situation properly?
Please don't tell me to avoid such situations by informing people in advance about my plans. I know I made a mistake there. The question is about how to handle such situations when you missed the opportunity to tell them about your plans in advance.