
105 Cal.Rptr.2d 281 (2001)
87 Cal.App.4th 1222
Jorge Sandoval VALENCIA et al., Plaintiffs, Cross-Defendants and Respondents,
v.
Jose C. RODRIGUEZ et al., Defendants, Cross-Complainants and Appellants.
No. B141937.
Court of Appeal, Second District, Division Two.
March 22, 2001.
Rehearing Denied April 18, 2001.
*282 Barry M. Orlyn, Westwood, for Defendants, Cross-Complainants and Appellants.
Karlin & Karlin and Marc A. Karlin, Los Angeles, for Plaintiffs, Cross-Defendants and Respondents.
TODD, J.
In the trial court appellants Jose C. Rodriguez and Martha C. Rodriguez[1] entered into a settlement agreement with respondents Jorge Sandoval Valencia and Maria Milan De Sandoval[2] on the record. Unknown to Sandoval and the trial court, Jose C. Rodriguez had filed a bankruptcy petition that was then pending. Shortly after the settlement, Sandoval and the trial court received notice of the bankruptcy. As a result, Sandoval made no effort to enforce the settlement agreement despite Rodriguez's failure to comply with its terms. After dismissal of the bankruptcy petition, Sandoval's motion to enforce the settlement agreement and to enter judgment in accordance with Code of Civil Procedure section 664.6, was granted. Rodriguez contends all proceedings during the bankruptcy proceedings were void and that the settlement agreement was therefore unenforceable.
We disagree and affirm.


*283 FACTUAL AND PROCEDURAL BACKGROUND
On May 12, 1997, Sandoval filed suit against Rodriguez for fraud, negligent misrepresentation, breach of contract and rescission in connection with the purchase of real property from Rodriguez. Sandoval alleged Rodriguez falsely represented that the property had been zoned for five residential units and plans for the construction had been submitted and approved by the city. Jose Rodriguez filed a cross-complaint against Sandoval and others for failing to make payments under the installment land sale contract.
On July 27, 1998, the underlying matter was settled on the record with the parties and their counsel present. Rodriguez stipulated to a judgment of $70,000 in favor of Sandoval which was to be stayed if Rodriguez paid Sandoval $20,000 in installments. There was no agreement for Sandoval to pay Rodriguez anything on the cross-complaint.
On August 6, 1998, Rodriguez filed and served Notice of Bankruptcy Stay on Sandoval representing that he had filed a bankruptcy petition on June 8, 1998. On October 16, 1998, the bankruptcy petition was dismissed and by order of the bankruptcy court the case was closed March 29, 1999.
Subsequently, Sandoval filed a motion seeking enforcement of the settlement pursuant to Code of Civil Procedure section 664.6, or alternatively the imposition of sanctions for attorney fees and costs incurred between June 8, 1998 and August 6, 1998, the period between the filing of the bankruptcy petition and notice to the parties and the court. A declaration in support of the motion by Sandoval's counsel stated that plaintiffs had not sought enforcement of the settlement agreement due to the pendency of the bankruptcy although the agreement had been breached by Rodriguez.
The trial court granted the motion for enforcement of the settlement, stating: "The Court finds that the now-dismissed bankruptcy filing by defendant Jose Rodriguez does not operate as a bar to enforce the settlement agreement reached in this case while the stay was in effect. The Court further finds that justice and equity demand that the otherwise valid agreement reached on the record in this matter be enforced, especially since defendants were represented by counsel during the negotiations and neither the plaintiffs nor the Court had notice of the bankruptcy filing. The automatic stay did not prevent the parties from entering into an agreement that became enforceable upon the dismissal of the bankruptcy case."
Judgment was entered in favor of Sandoval for $70,000 plus interest and costs. Rodriguez received nothing on the cross-complaint. Rodriguez filed a timely notice of appeal from the judgment.

DISCUSSION
The sole issue on appeal is whether an otherwise enforceable settlement agreement is void and unenforceable under the automatic stay provisions because a party to the agreement, without notice to the other party, had earlier filed a petition in bankruptcy which was still pending, or whether the agreement can be enforced after the bankruptcy petition is dismissed and the bankruptcy case closed.
Section 362(a), title 11 of the United States Code provides that, with certain exceptions not applicable here, "a petition filed under section 301, 302, or 303 of this title ... operates as a stay, applicable to all entities, of[¶] (1) the commencement or continuation, including the issuance or employment of process, of a judicial, administrative, or other action or proceeding against the debtor that was or could have been commenced before the commencement of the case under this title, or to recover a claim against the debtor that arose before the commencement of the case under this title; [¶] ... [¶] (6) any act to collect, assess, or recover a claim *284 against the debtor that arose before the commencement of the case under this title; [¶] (7) the setoff of any debt owing to the debtor that arose before the commencement of the case under this title against any claim against the debtor...."
"`"When a debtor files a bankruptcy petition, an automatic stay immediately arises."'" (Thomas v. Gordon (2000) 85 Cal.App.4th 113, 119, 102 Cal. Rptr.2d 28.) The automatic stay is operative even without notice. (In re Sumpter (Bankr.N.D.Ill.1994) 171 B.R. 835, 841.) The stay is automatically and immediately terminated upon dismissal of the bankruptcy action. (Raczynski v. Judge (1986) 186 Cal.App.3d 504, 511-512, 230 Cal.Rptr. 741.)
Sandoval's contention that the automatic stay did not bar the settlement agreement solely because Rodriquez entered into the agreement without giving notice of the bankruptcy is without merit. When Jose Rodriguez filed his bankruptcy petition, the automatic stay immediately applied to the underlying action even though Sandoval and the trial court did not receive prompt notice of its filing. (In re Sumpter, supra, 171 B.R. at page 841.) Still, we must decide whether entry into the settlement agreement violated the automatic stay and what, if any, effect the stay had on the enforceability of the agreement.
"The purpose of the automatic stay is to give the debtor a breathing spell from his creditors, to stop all collection efforts, harassment and foreclosure actions. Notes of Committee on the Judiciary, Sen.Rep.No. 989, 95th Cong., 2d Sess. 54, reprinted in [1978] U.S.Code Cong. & Ad.News 5787, 5840. The automatic stay also prevents piecemeal diminution of the debtor's estate. See Bohack Corp. v. Borden, Inc., 599 F.2d 1160, 1167 (2d Cir. 1979). The automatic stay does not necessarily prevent all activity outside the bankruptcy forum. See David v. Hooker, Ltd., 560 F.2d 412, 417-18 (9th Cir.1977) (automatic stay under old bankruptcy act did not prevent trial judge in a separate case from requiring the debtor to comply with a discovery order issued prior to the filing of the insolvency petition)." (Matter of Roach (9th Cir.1981) 660 F.2d 1316, 1318-1319.)
In Tully v. World Savings & Loan Association (1997) 56 Cal.App.4th 654, 65 Cal. Rptr.2d 545 plaintiffs sought to set aside a non-judicial foreclosure sale. One argument plaintiffs advanced was that defendant was obliged to re-publish notice of sale because the last day of the period of publication coincided with the filing of plaintiffs' petition in bankruptcy. (Tully, at pp. 661-662, 65 Cal.Rptr.2d 545.) Plaintiffs argued that the bankruptcy stay prevented the completion of the required notice of sale. The court relied on Roach in rejecting this argument, finding as a matter of law that publication of the notice was not invalidated by and did not violate the federal bankruptcy stay. (Tully, at p. 663, 65 Cal.Rptr.2d 545.)
In Raczynski v. Judge, supra, 186 Cal. App.3d 504, 230 Cal.Rptr. 741 defendant appealed a default judgment against him. After failing to respond to discovery orders the trial court struck defendant's answer and entered a default judgment against him. Defendant unsuccessfully moved to set aside the default and reinstate the answer on the ground that the court was without jurisdiction to strike the answer and enter his default because he had filed a petition under chapter 11 of the Bankruptcy Act before the date of the order that was not dismissed until after that date. (Id. at p. 512, 230 Cal.Rptr. 741.) The trial court did not enter judgment on the default until after the bankruptcy was dismissed.
The court in Raczynski concluded that the dismissal of the bankruptcy "`(3) revests the property of the estate in the entity in which such property was vested immediately before the commencement of the case under this title.' (§ 349(b), tit. 11 U.S.C.) The objective of this provision `is to undo the title 11 case, in so far as is practicable, and to restore all property rights to the position they occupied at the *285 beginning of such case.' (2 Collier, Bankruptcy (15th ed.1986) [¶] 349.01, p. 349-2; fn. omitted.) `Undo' means `to make of no effect or as if not done.' (Webster's New Internat. Diet. (3d ed.1981) p. 2492.) Thus, while the order striking defendant's answer and entering his default was made on April 23, 1985, the subsequent dismissal of the bankruptcy petition served to validate that order. It follows that the default judgment, which was entered after dismissal of the petition and termination of the stay, is valid despite the fact it is based on an order made in this lawsuit while the stay was in effect." (Raczynski v. Judge, supra, 186 Cal.App.3d at p. 512, 230 Cal. Rptr. 741.)
In the case before us, Rodriguez voluntarily and with representation of counsel proceeded to enter into the settlement agreement with Sandoval while the automatic stay was in force. After notice of the bankruptcy petition Sandoval took no action to enforce the agreement while the stay was in effect. Rodriguez offered no argument in opposition to the motion to enforce other than reliance on the automatic stay. There is no evidence of collection efforts or harassment of Rodriguez, or piecemeal diminution of the bankruptcy estate or any prejudice to any other creditors.
Thus, even if the settlement agreement here was precluded by the automatic stay, we conclude that the dismissal of the bankruptcy petition served to validate the settlement agreement. The trial court was correct in ruling that once the bankruptcy proceeding was dismissed, there was nothing to prevent the agreement from being enforced.

DISPOSITION
The judgment is affirmed.
NOTT, Acting P.J., and COOPER, J., concur.
NOTES
[1]  Jose C. Rodriguez and Martha O. Rodriguez are collectively referred to as "Rodriguez."
[2]  Jorge Sandoval Valencia and Maria Milan De Sandoval are collectively referred to as "Sandoval."
