Bush, who was visiting with family members, probably will remain in Methodist Hospital until next week, family spokesman Jim McGrath said in a statement.
The surgery, a minimally invasive procedure involving a small incision in the abdomen, was Tuesday night. Surgeons cleansed her abdominal area and closed a one-centimeter hole caused by the ulcer, McGrath said.
Bush went to the hospital as a precaution Tuesday night after experiencing some abdominal pains. Former President George H.W. Bush was with her.
"She's feeling great, and he is feeling very good," said Jim Appleby, a spokesman for the Office of George Bush. "The surgery went just fine and she is recovering nicely."
Current first lady Laura Bush, Barbara Bush's daughter-in-law, said Wednesday: "She's doing great. George and I talked to both President Bush and Barbara Bush last night while they were in the hospital and they were both doing very well then."
Interviewed on ABC's "Good Morning America," Laura Bush said the White House doctor had spoken to Barbara Bush's doctor Wednesday morning and "she's doing very well."
Barbara Bush is 83.
The former Barbara Pierce, daughter of the publisher of McCall's magazine, married George H.W. Bush in January 1945 when he returned a hero from World War II.
She was the girl who, swept off her feet by a handsome Navy aviator, dropped out of college to marry him, "the first man I ever kissed."
They had had their first child, George, while still at Yale in 1946. A daughter, Robin, died in 1953 of leukemia a few weeks before her 4th birthday. The other Bush children are sons Jeb, Neil and Marvin, and daughter Dorothy.
Mrs. Bush disclosed she was suffering from an overactive thyroid ailment known as Graves' disease when she lived at the White House. The disease causes teary eyes and double vision in Mrs. Bush, according to her doctors.