Commercial Fixed Wing
Flight Crew Multiengine; Flight Crew Instrument; Flight Crew Air Transport Pilot (ATP)
Time Pressure; Confusion; Communication Breakdown
Deviation / Discrepancy - Procedural Published Material / Policy; Ground Event / Encounter Other / Unknown
General Flight Cancelled / Delayed
Airport; Company Policy
In ZZZZ loading was taking too long so I stopped our duty day because at our arrival point we would be over our legal XX hours.  I asked the company for hotel rooms for the crew.  The Handler informed us we would need to stay in a government designated hotel and undergo COVID-19 testing or stay on the airplane.  We chose the hotel.  The handler and a [company representative] informed us the immigration service of foreign country denied our crew entry into the country and we were not permitted to leave the airplane.  I asked the Directors of Operations; Safety; and Standards; and the Chief Pilots if this would be legal Rest for our upcoming Part 121 assignment and got no response from any of them prior to our new (after minimum rest time) departure time; so I asked my crew if they felt safe to fly and they all said yes; we departed.  We were in a foreign country subject to our Handler's communication with local immigration officials and them informing us what we could or could not do.  We were even warned not to leave the aircraft by the handler to walk over to our other company airplane on the ramp as it could subject us to serious consequences if we were detected by Immigration.   When we realized we had no alternate other than to obtain our Rest on board the aircraftA lack of planning on company Operations part in terms of how the Crew would be provided with normal hotel rest facilities should they get stuck in this location as we did.  Even if you book a hotel if Immigration won't let you leave to go to it it is of no use.I kept my crew 100 percent in the loop as to all communications and any of them were free to decline the 121 assignment after we obtained Rest on the airplane.  All of them told me they felt safe and were ready to fly.Plan for more than adequate time to load an airplane at this location.  X.X hours were allocated obviously that was not nearly enough.
Though we were as a flight crew rested; alert and fully capable of conducting the flight safely; local authorities had denied our entry into the country. We were forced to obtain rest prior this leg in the aircraft. Again; to restate; we had no choice other than to stay in the aircraft during our rest period. Our choice was originally to be tested for COVID-19 and risk quarantine to obtain adequate rest in the hotel. I personally witnessed company's efforts to get us into a suitable hotel. Those efforts were denied by local officials as relayed through emails from our handler.We were aware prior to the flight that it would be necessary to depart after resting in the aircraft.1) Mechanical delay departing ZZZZ on previous leg. 2) Failure of our handler to obtain rights to enter the country to ensure proper rest facility.All attempts were made to complete the flight within the originally scheduled duty day. We even suggested a shorter flight time to a different destination for a crew change. All efforts made by the crew were denied by the handler.Explain to the customer / handler that it will be necessary to obtain permission for the crew to stop enroute for a crew change if the loading is delayed. Please note here that the load being stopped and the crew departing within the appropriate duty day was an option given to the handler. The choice was made to continue with the full loading of the aircraft.
Air carrier flight crew reported that they had to get their required rest on the aircraft instead of at a hotel. The flight crew stated that although they had agreed to take a COVID-19 test to stay at the hotel; the foreign country's immigration service did not allow them to leave the aircraft.