accidentally
verb
"He discovered penicillin largely accidentally."
"He accidentally exposed the bacteria to mold spores."