Aircraft: LARGE TRANSPORT
Phase of flight: Initial Approach
Anomaly: ATC Issue All Types; Deviation - Altitude Undershoot; Deviation / Discrepancy - Procedural Published Material / Policy

We were arriving in SAN on the LYNDI3 RNAV arrival and the controller took us off the arrival with vectors and altitude and speed instructions. We followed her instructions and repeated them back each time she gave them to us. She never put us back on the arrival; but instead cleared us to the RNAV RWY 27 approach fix and cleared us to 4;000 feet. She cleared us direct VYDDA; descend to 4;000 feet; cleared RNAV 27 approach. I repeated 'direct VYDDA; descend to 4;000 feet; cleared RNAV 27'. We were in perfectly clear skies and could see all ground objects. We both noted that the clearance brought us pretty low; but our flight path took us clear of any terrain. At about 4;200 feet the controller contacted us with an urgent request to immediately climb back to 5;000 feet and maintain 5;000 feet. We stopped our descent and climbed back to 5;000 feet and maintained constant clearance of all terrain and objects. We both looked at the approach plate again and noticed that VYDDA crossing restriction was 4;000+; so we assumed that the controller screwed-up and descended us to 4;000 feet a little too early or that our descent rate was faster than she had predicted. Since we were off the arrival and under her control; and since VYDDA crossing restriction was 4;000+; we felt we could accept her clearance to 4;000 feet. We felt this was a controller error. Within a few seconds of climbing back to 5;000 feet she once again cleared us for the approach. Please note that the controller seemed very stressed at the time and seemed to be struggling with traffic issues; which is why she took us off the arrival and vectored us in the first place.I believe the event was a controller mistake due to heavy workload. She was trying to time the traffic for the approach and took us off the arrival with vectors; altitude; and speed instructions. As we got closer and closer to the airport; she could no longer put us back on the arrival; so she cleared us for the approach and descend to 4;000 feet; but apparently she gave us the 4;000 foot altitude too early and we descended below the MDA briefly before passing the constraint line. At no time was the aircraft in danger of hitting the obstacles as we maintained clear visual separation at all times.In this case; I'm not sure what we as pilots could have done differently. We were no longer on the arrival and were following controller instructions. We are trained that when flying in foreign countries; especially South and Central America; that we must check all MDA's and know that those controllers will descend you and it is up to you to determine if that is a safe altitude. But in USA; we are told our controllers will NOT descend you below the MDA and that we can trust our controller instructions. Even so; I checked the approach and noticed that we were allowed to 4000+ for VYDDA intersection; so once again; we accepted the clearance. I believe this was a controller error. We were flying the LYNDI3 arrival into SAN. ATC vectored us off the arrival. I cannot remember if an initial altitude was given to us or not. I am thinking that initially she gave us 5;000 feet. She then cleared us to 4;000 feet and gave us a southerly heading. Visibility was unlimited and I had my terrain GPWS selected. I made the statement to the FO that I was surprised that she could clear us to that low of an altitude. However; I never thought it was unsafe; but I remember that it didn't seem like she was leaving much room for error. She was very busy on the radio. She then came on and instructed us to climb immediately to 5;000 feet and that we had a low altitude alert. My thought was that ATC must have messed up. I never doubted that we were cleared to 4;000 feet. From my perspective; we complied with all of ATC instructions. A Controller cleared an air carrier crew to 4;000 feet on SAN LYNDI THREE RNAV arrival and then issued a terrain alert with a clearance back to 5;000 feet. The crew suspected a SCT Controller error.