system
Given the following post, respond as if you're commenting on Reddit:
human
[Star Trek] How would the Federation handle a Pre-Warp civilization with galactic ambitions?

Let's say there is a planet with a high population, nuclear weapons, and the ambition to conquer the galaxy. They make a deal with an enemy of the Federation to get modern weapons technology, and start manufacturing photon torpedoes to arm their ships.

Fortunately for the Federation, they never developed warp technology. Instead, they travel for decades in massive fleets, raising new generations in colony ships at sub-light speed travel. 

They show up with a massive fleet near Earth, promising total destruction unless Earth surrenders within 24 hours. 

The Prime Directive forbids the Federation from interfering with Pre-Warp civilizations. Obviously the Federation can defend themselves, but can they strike back against the attackers? Knowing that the colony ships are filled with non-combatants and children, would the Federation destroy them or simply shield Earth? 

If the attackers are defeated but refuse to surrender and keep building fleets of ships, could the Federation occupy and/or exterminate the planet?

Would there be a political outcry among the general population if the Federation was seen as bullying or committing genocide against a primitive (but aggressive) people?

**Edit:** I know it's not likely for a pre-warp civilization to be able to make it Earth. I was more interested in the political/legal ramifications, but it seems like that's pretty clear-cut too. The Prime Directive doesn't apply when the pre-warp civilization goes looking for a fight. Got it. I surrender.
gpt
>The Prime Directive forbids the Federation from interfering with Pre-Warp civilizations.  

While 'pre-warp' gets tossed around a lot, it's not actually the key characteristic in terms of the Prime Directive.  There's nothing magical about the warp drive specifically that allows interaction with the Federation.  It's just that usually civilizations become ready for contact at about the time they develop warp capability.  
Your hypothetical civ has had contact with interplanetary civilizations, has begun acting on a quadrant level, and have initiated contact with the Federation.  Any one of those things takes the Prime Directive out of play, and the Federation is free to interact as appropriate.  
In this case, that probably means intercepting them in deep space before they get anywhere near Earth, and hammering out a peaceful solution.  
Additionally, you're talking centuries of travel, not decades.  This fleet's weapons and shield tech is going to be hilariously out of date long before they actually get to Earth.  This will make negotiation possible even in the case that they're ridiculously belligerent.