Updated

The father of Casey Anthony, who is accused of killing her 2-year-old daughter, testified Wednesday that he wrote a suicide note saying he had unanswered questions about what happened to his granddaughter, a revelation that undermines defense claims that the toddler drowned accidentally and he helped cover it up.

Anthony, 25, is accused of killing her toddler daughter, Caylee, in 2008. She has pleaded not guilty to first-degree murder and could face the death penalty if convicted of that charge.

Prosecutors say Anthony suffocated her daughter by placing duct tape over her nose and mouth, while defense attorneys claim Caylee accidentally drowned in the family's swimming pool. The defense team also contends that Anthony and her father, George, covered up the accident -- a theory George Anthony has denied. The child's remains were found in December 2008 -- almost six months after she was reported missing -- and no cause of death has been determined.

On Wednesday, defense attorney Jose Baez asked George Anthony about his Jan. 22, 2009, suicide attempt. Later, prosecutor Jeff Ashton asked Anthony if he had bought a gun five months before that and Baez objected.

With the jury out of the room, George Anthony said he planned to use the gun to try to get his daughter's friends to tell him what happened to Caylee.

Anthony testified that he wrote in his suicide note about "unanswered questions" and that he chose to kill himself because "I needed at that time to go be with Caylee because I knew I failed her."

Ashton argued that the statements were valid for the jury to hear because they rebutted the drowning theory and implied that George Anthony didn't know what really happened to Caylee. Ashton also said the suicide note did not include any reference to George Anthony molesting Casey Anthony when she was a child, as Baez claimed in his opening statement.

Judge Belvin Perry agreed the jury could hear about the gun purchase and the suicide note.

"It looks to me like someone opened the door and someone is trying to walk through it," he said.

When the jury came back, George Anthony got emotional as he recounted the months before his suicide attempt, in which he drove to Daytona Beach and tried to overdose on prescription medication.

"I tried to take my own life," he told Baez. "That’s not an 'alleged.' That happened.”

Anthony also said he never got the opportunity to confront his daughter's friends because law enforcement confiscated the gun the day after he bought it in August 2008. Casey was out on bond and staying in his home, and firearms are prohibited in a place where a person on bond is living.

The defense attorneys have continued their strategy of painting the Anthony family as dysfunctional.

Baez questioned George Anthony earlier about accusations from the defense team that he sexually molested Casey Anthony as a child.

"I would never do anything like that to my daughter," Anthony said, which prompted Baez to ask, "You would never admit to it would you?"

Casey Anthony appeared to be shaking her head in what appeared to be a "no" motion during that part of her father's testimony.

George Anthony also testified that he was "100 percent sure" he smelled human decomposition coming from his daughter's car.

"I could smell it 3 feet away on the passenger side. When I opened up that car door, yeah, it smelled like decomposition … human decomposition," Anthony told the jury, adding that he was able identify the odor of human decay after years of working in law enforcement.

The defense also called another witness to the stand Wednesday -- the estranged son of Roy Kronk, the Orlando County meter reader who found Caylee's remains.

Kronk's son, Brandon Sparks, said his father told him about the discovery weeks before police told the public the body was found -- a revelation that could support the defense's claim that Kronk moved or hid Caylee's remains in an attempt to profit from an award.

“I asked him why he waited so long” to report finding the body, Sparks said. “He didn’t have an answer.”

Click for complete coverage on the Casey Anthony murder trial from MyFoxOrlando.com

TIMELINE: The Casey Anthony murder trial

The Associated Press contributed to this report